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...> - 2005-03-06 15:56:03
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2788 Modified Files: MANIFEST Added Files: package.ini Removed Files: package.conf Log Message: move package to new format (package.conf -> package.ini; move doc/ -> OI2::App) --- NEW FILE: package.ini --- [package] name = delicious_tags version = 0.09 author = Chris Winters <ch...@cw...> url = http://www.openinteract.org/ sql_installer = OpenInteract2::SQLInstall::DeliciousTags config_watcher = OpenInteract2::DeliciousTagWatcher description = Lightweight tags to related any objects. Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/MANIFEST,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MANIFEST 27 Nov 2004 18:05:23 -0000 1.6 --- MANIFEST 6 Mar 2005 15:55:51 -0000 1.7 *************** *** 2,9 **** MANIFEST MANIFEST.SKIP ! package.conf conf/action.ini conf/spops.ini - doc/delicious_tags.pod msg/delicious_tags-en.msg struct/delicious_tags.sql --- 2,8 ---- MANIFEST MANIFEST.SKIP ! package.ini conf/action.ini conf/spops.ini msg/delicious_tags-en.msg struct/delicious_tags.sql *************** *** 13,16 **** --- 12,16 ---- OpenInteract2/DeliciousTagWatcher.pm OpenInteract2/Action/DeliciousTags.pm + OpenInteract2/App/DeliciousTags.pm OpenInteract2/Observer/AddDeliciousTags.pm OpenInteract2/SQLInstall/DeliciousTags.pm --- package.conf DELETED --- |
From: Chris W. <la...@us...> - 2005-03-06 15:56:02
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2788/OpenInteract2/App Added Files: DeliciousTags.pm Log Message: move package to new format (package.conf -> package.ini; move doc/ -> OI2::App) --- NEW FILE: DeliciousTags.pm --- package OpenInteract2::App::DeliciousTags; # $Id: DeliciousTags.pm,v 1.1 2005/03/06 15:55:51 lachoy Exp $ use strict; use base qw( Exporter OpenInteract2::App ); use OpenInteract2::Manage; $OpenInteract2::App::DeliciousTags::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); @OpenInteract2::App::DeliciousTags::EXPORT = qw( install ); sub get_brick_name { return 'delicious_tags'; } # Not a method, just an exported sub sub install { my ( $website_dir ) = @_; my $manage = OpenInteract2::Manage->new( 'install_package' ); $manage->param( website_dir => $website_dir ); $manage->param( package_class => __PACKAGE__ ); return $manage->execute; } __END__ =pod =head1 NAME OpenInteract2::App::DeliciousTags - Mark generic objects with simple text tags =head1 SYNOPSIS # Mark an action ('myaction') with the delicious observer; this means # it will attach tags found in the request variable 'delicious_tags' # to the object found in the action parameter 'object' or 'c_object' # whenever it's saved or issues a 'post add' or 'post update' # notification; this is done automatically for you if you're using # the Common actions # in $WEBSITE_DIR/conf/observer.ini [observer] delicious = OpenInteract2::Observer::AddDeliciousTags [map] delicious = myaction # Mark an object ('myobject') as taggable with delicious tags; this # will add a few methods to the base object # in $PKG_DIR/conf/spops_myobject.ini [myobject] class = OpenInteract2::Foo ... is_taggable = yes # Once marked as taggable you can execute methods that: # - Find tags attached to object my $tags = $myobject->fetch_my_tags; print "Object tagged with: ", join( ', ', @{ $tags } ); my $tags_with_count = $myobject->fetch_my_tags_with_count; print "Object tagged with:\n"; foreach my $tag_and_count( @{ $tags_with_count } ) { print " - $tag_and_count->[0]: $tag_and_count->[1]\n"; } # - Find other objects with any of the same tags as this one my $related_info = $myobject->fetch_related_object_info; # - Find other objects with the tag 'sometag' my $related_info = $myobject->fetch_related_object_info( 'sometag' ); # - Find other objects with the tags 'sometag' or 'someothertag' my $related_info = $myobject->fetch_related_object_info( 'sometag', 'someothertag' ); print "Object related to:\n"; foreach my $info ( @{ $related_info } ) { my $url = OpenInteract2::URL->create( $info->{url}, {}, 1 ); print " - $info->{title} ($info->{type})\n", " Tag: $info->{tag}; URL: $url\n"; } # Class methods on our SPOPS class my $tag_class = CTX->lookup_object( 'delicious_tag' ); # Fetch available tags my $tags = $tag_class->fetch_all_tags; print "Available tags: ", join( ', ', @{ $tags } ); # Fetch available tags with the number of objects in each my $tags_and_counts = $tag_class->fetch_all_tags_with_count; foreach my $tag_and_count( @{ $tags_with_count } ) { print "$tag_and_count->[0]: $tag_and_count->[1]\n"; } # You can also fetch as an arrayref of hashrefs my $tags_and_counts = $tag_class->fetch_all_tags_with_count( {} ); foreach my $tag_and_count( @{ $tags_with_count } ) { print "$tag_and_count->{tag}: $tag_and_count->{count}\n"; } # Fetch a count by tag my $count = $tag_class->fetch_count( 'sometag' ); print "Number of objects with tag 'sometag': $count\n"; # Find related tags -- this will find all other tags attached to # objects attached to this tag my $tags = $tag_class->fetch_related_tags( 'sometag' ); print "Other tags related to 'sometag': ", join( ', ', @{ $tags } ); # Similarly, find tag and count for related tags print "Also related to 'sometag':\n"; my $tags = $tag_class->fetch_related_tags_with_count( 'sometag' ); foreach my $tag_and_count( @{ $tags_with_count } ) { print " - $tag_and_count->{tag}: $tag_and_count->{count}\n"; } # In your template you can add a box to display the current item's # tags: [% OI.box_add( 'related_items_box', object = news ) %] =head1 DESCRIPTION This module allows you to add arbitrary textual tags to objects. It is a simple copy of the ideas at L<http://del.icio.us/>, a social bookmarking system. An earlier version of this same idea was available in the OpenInteract 1.x package C<object_link> but it was much heavier and much less flexible. The beauty of these tags is that you can create them whenever you want -- there's no separate table of 'tags' you need to maintain -- and they're just simple text. There's no weighting or any other features, just tags. =head2 Tag interaction overview The class L<OpenInteract2::DeliciousTaggableObject> is used for getting data into and out of the system. If you mark your SPOPS object with: is_taggable = yes then its methods will be available from every object in that class. Otherwise you need to use the methods prefixed with 'c_' (class). =head2 Getting tags into the system The best way is to use the action observer L<OpenInteract2::Observer::AddDeliciousTags>. Once it's configured as discussed in L<SYNOPSIS> it will sit back and watch all 'post add' and 'post update' action observations. When it catches one it will look for the object added or updated and its asssociated tag data; if both are found the observer will tag that object. You make the object available in the action parameter 'object' or 'c_object'. And you make your object's tags available via either the request parameter 'tags' (typically coming in through GET/POST) or the action parameter 'tags'. While you'll typically use the request parameter to input the tags so the user can edit the tags with the object, you might use some sort of textual analysis program to pull tags out of the object's content. To accomplish this in your action you might have: sub update { my ( $self ) = @_; ... eval { $my_object->save() }; if ( $@ ) { oi_error ... } # if save ok... my @tags = $my_object->analyze_content(); # ...save tags as arrayref... $self->param( 'tags' => \@tags ); # ...or as space-separated string $self->param( 'tag' => join( ' ', @tags ) ); # Store tags... # ...if class for '$my_object' marked with 'is_taggable = yes': $my_object->add_tags( @tags ); # ...if not so marked OpenInteract2::DeliciousTaggableObject::add_tags( $my_object, @tags ); # ...or if $my_object is not an SPOPS object OpenInteract2::DeliciousTaggableObject->c_add_tags( 'My Type', $my_object->id, '/my_object/display/" . $my_object->id, $my_object->name . ': ' . $my_object->description, @tags ); ... =head2 Getting tags out of the system You can grab all tags with: my $tag_class = CTX->lookup_object( 'delicious_tag' ); my $all_tags = $tag_class->fetch_all_tags; print "All tags in system: ", join( ', ', @{ $all_tags } ); You can also grab the corresponding counts with: my $all_tags_and_counts = $tag_class->fetch_all_tags_with_count; print "All tags in system:\n"; foreach my $tag_and_count ( @{ $all_tags_and_counts } ) { print "$tag_and_count->[0]: $tag_and_count->[1]\n"; } If you prefer to use a hashref for each returned tag + count: my $all_tags_and_counts = $tag_class->fetch_all_tags_with_count( {} ); print "All tags in system:\n"; foreach my $tag_and_count ( @{ $all_tags_and_counts } ) { print "$tag_and_count->{tag}: $tag_and_count->{count}\n"; } =head2 Getting tagged objects out of the system You can get a description of all objects with a particular tag: my $tag_class = CTX->lookup_object( 'delicious_tag' ); # Find all the items tagged with 'linux' my $items = $tag_class->fetch_tag_objects( 'linux' ); foreach my $item ( @{ $items } ) { print "Item type: $item->{object_type} with ID $item->{object_id}\n", " Name: $item->{name}\n", " URL: $item->{url}\n"; } # Find all the items tagged with 'linux' or 'win32' my $items = $tag_class->fetch_tag_objects( [ 'linux', 'win32' ] ); # Find all the items tagged with 'linux' or 'win32' that aren't of the 'blog' type my $items = $tag_class->fetch_tag_objects( [ 'linux', 'win32' ], 'blog' ); =head1 OBJECTS L<delicious_tag> See L<OpenInteract2::DeliciousTag> for information on the additional methods. =head1 ACTIONS B<all_tags_box> Box to display all tags with the count for each. Example in template: [% OI.box_add( 'all_tags_box' ) %] B<related_tags_box> Box to display the tags and count related to a particular object. You need to pass in an 'object' or 'c_object' for it to work: Example in template: [% OI.box_add( 'related_tags_box', object = news ) %] B<tagged_items> Component to display items given a particular tag. You can invoke this anywhere, such as: <p> [% OI.action_execute( 'tagged_items', tag = 'perl' ) %] </p> B<tags> Currently has single URL-accessible task 'show_tagged_items' which displays a full-page version of the 'tagged_items' action. =head1 OBSERVERS L<OpenInteract2::Observer::AddDeliciousTags> Gets fired on a 'post add' or 'post save' of an action. It adds the tags from the request/action parameter 'tags' to the object in the action parameter 'object' or 'c_object'. See docs for details. =head1 CONFIGURATION WATCHERS L<OpenInteract2::DeliciousTagWatcher> Translates: [myspops] ... is_taggable = yes into a request to add L<OpenInteract2::DeliciousTaggableObject> to that SPOPS object's ISA. =head1 RULESETS No rulesets defined in this package. =head1 COPYRIGHT Copyright (c) 2004-5 Chris Winters. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS Chris Winters E<lt>ch...@cw...E<gt> =cut |
From: Chris W. <la...@us...> - 2005-03-06 15:56:01
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2788/doc Removed Files: delicious_tags.pod Log Message: move package to new format (package.conf -> package.ini; move doc/ -> OI2::App) --- delicious_tags.pod DELETED --- |
From: Chris W. <la...@us...> - 2005-03-06 15:54:43
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2455/OpenInteract2/App Log Message: Directory /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/App added to the repository |
From: Chris W. <la...@us...> - 2005-03-06 15:08:18
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24033/lib/OpenInteract2/Setup Modified Files: ReadSPOPSConfig.pm ReadActionTable.pm Log Message: OIN-117: read the action/spops files from new location Index: ReadSPOPSConfig.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup/ReadSPOPSConfig.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReadSPOPSConfig.pm 26 Feb 2005 23:31:25 -0000 1.2 --- ReadSPOPSConfig.pm 6 Mar 2005 15:08:05 -0000 1.3 *************** *** 50,55 **** foreach my $spops_file ( @{ $filenames } ) { $log->debug( "SPOPS file: $spops_file" ); ! my $full_spops_path = $package->find_file( $spops_file ); ! my $ini = $self->_read_ini( $full_spops_path ); next SPOPSFILE unless ( $ini ); --- 50,54 ---- foreach my $spops_file ( @{ $filenames } ) { $log->debug( "SPOPS file: $spops_file" ); ! my $ini = $self->_read_ini( $spops_file ); next SPOPSFILE unless ( $ini ); *************** *** 77,81 **** $spops_assign{package_name} = $package->name; $spops_assign{package_version} = $package->version; ! $spops_assign{package_config_file} = $full_spops_path; $spops_assign{datasource} ||= $default_datasource; --- 76,80 ---- $spops_assign{package_name} = $package->name; $spops_assign{package_version} = $package->version; ! $spops_assign{package_config_file} = $spops_file; $spops_assign{datasource} ||= $default_datasource; Index: ReadActionTable.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup/ReadActionTable.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReadActionTable.pm 24 Jan 2005 17:17:31 -0000 1.1 --- ReadActionTable.pm 6 Mar 2005 15:08:05 -0000 1.2 *************** *** 53,60 **** ACTIONFILE: foreach my $action_file ( @{ $filenames } ) { - my $full_action_path = $package->find_file( $action_file ); $log->debug( "Reading action file from package ", ! "$package_id: $full_action_path" ); ! my $ini = $self->_read_ini( $full_action_path ); # error is added to log from _read_ini() call, don't do it here too --- 53,59 ---- ACTIONFILE: foreach my $action_file ( @{ $filenames } ) { $log->debug( "Reading action file from package ", ! "$package_id: $action_file" ); ! my $ini = $self->_read_ini( $action_file ); # error is added to log from _read_ini() call, don't do it here too *************** *** 74,78 **** } my $action_data = $self->_create_single_action_data( ! $package, $full_action_path, $action_name, $ini->{ $action_name } ); $ACTION->{ $action_name } = $action_data; --- 73,77 ---- } my $action_data = $self->_create_single_action_data( ! $package, $action_file, $action_name, $ini->{ $action_name } ); $ACTION->{ $action_name } = $action_data; |
From: Chris W. <la...@us...> - 2005-03-06 15:07:49
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23910/lib/OpenInteract2/Manage/Website Modified Files: CreateSecurity.pm Log Message: add our 'use' Index: CreateSecurity.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/CreateSecurity.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CreateSecurity.pm 4 Mar 2005 02:50:01 -0000 1.5 --- CreateSecurity.pm 6 Mar 2005 15:07:29 -0000 1.6 *************** *** 8,11 **** --- 8,12 ---- use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); + use OpenInteract2::CreateSecurity; use OpenInteract2::Exception qw( oi_error oi_param_error ); |
From: Chris W. <la...@us...> - 2005-03-06 15:07:19
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23838/lib/OpenInteract2 Modified Files: Repository.pm Log Message: ensure we have a package to actually remove... Index: Repository.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Repository.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Repository.pm 26 Feb 2005 23:31:24 -0000 1.22 --- Repository.pm 6 Mar 2005 15:07:07 -0000 1.23 *************** *** 179,182 **** --- 179,183 ---- sub remove_package { my ( $self, $package, $options ) = @_; + return unless ( $package ); $self->_remove_package_info( $package->name ); unless ( $options->{transient} && 'yes' eq $options->{transient} ) { |
From: Chris W. <la...@us...> - 2005-03-06 15:06:47
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23733/lib/OpenInteract2 Modified Files: Package.pm Log Message: OIN-117: modify package to conditionally copy from 'conf/' into $WEBSITE_DIR/conf/$PACKAGE when installing a packae to a website; 'conditionally' means that if there are files of the same name already there we check 'CHECKSUMS' to see if our new file is the same -- if the file is the same we do nothing, but if the file is different we copy it to an 'updates/' subdirectory with the version number appended; also modify 'get_spops_files()' and 'get_action_files()' to read from that directory if a 'repository' property is set in the package Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Package.pm,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Package.pm 28 Feb 2005 00:59:18 -0000 1.50 --- Package.pm 6 Mar 2005 15:06:36 -0000 1.51 *************** *** 249,256 **** $base_files = [ grep { m|^conf/spops.*\.ini$| } @{ $files } ]; } ! my $dir = $self->directory; ! my @spops_files = map { catfile( $dir, $_ ) } @{ $base_files }; $self->_check_file_validity( \@spops_files ); ! return $base_files } --- 249,263 ---- $base_files = [ grep { m|^conf/spops.*\.ini$| } @{ $files } ]; } ! my @spops_files = (); ! if ( my $rep = $self->repository ) { ! my $dir = catdir( $rep->website_dir, 'conf', $self->name ); ! @spops_files = map { s|^conf/||; catfile( $dir, $_ ) } @{ $base_files }; ! } ! else { ! my $dir = $self->directory; ! @spops_files = map { catfile( $dir, $_ ) } @{ $base_files }; ! } $self->_check_file_validity( \@spops_files ); ! return \@spops_files } *************** *** 266,273 **** ]; } ! my $dir = $self->directory; ! my @action_files = map { catfile( $dir, $_ ) } @{ $base_files }; $self->_check_file_validity( \@action_files ); ! return $base_files } --- 273,287 ---- ]; } ! my @action_files = (); ! if ( my $rep = $self->repository ) { ! my $dir = catdir( $rep->website_dir, 'conf', $self->name ); ! @action_files = map { s|^conf/||; catfile( $dir, $_ ) } @{ $base_files }; ! } ! else { ! my $dir = $self->directory; ! @action_files = map { catfile( $dir, $_ ) } @{ $base_files }; ! } $self->_check_file_validity( \@action_files ); ! return \@action_files; } *************** *** 347,354 **** $log->info( "Unpacked package into '$full_package_dir' ok" ); ! my $installed_package = $class->new({ directory => $full_package_dir, ! repository => $repository }); $installed_package->installed_date( scalar( localtime ) ); ! my $copied_files = $installed_package->_install_copy_files; $log->is_info && $log->info( "Copied package files to website ok" ); --- 361,371 ---- $log->info( "Unpacked package into '$full_package_dir' ok" ); ! my $installed_package = $class->new({ ! directory => $full_package_dir, ! repository => $repository, ! }); $installed_package->installed_date( scalar( localtime ) ); ! $installed_package->_install_html_and_widget_files_to_website; ! $installed_package->_install_conf_files_to_website; $log->is_info && $log->info( "Copied package files to website ok" ); *************** *** 681,810 **** } ! sub _install_copy_files { my ( $self ) = @_; ! unless ( $self->repository ) { ! my $pkg_dir = rel2abs( $self->directory ); ! warn "Cannot copy files from package '", $self->name, "' to ", ! "website because there is no repository set in package. ", ! "You will need to copy the files from '$pkg_dir/html' and ", ! "'$pkg_dir/widget' (if they exist) to the website manually.\n"; ! return; } ! my %file_map = map { $_ => 1 } @{ $self->get_files }; ! ! my @html_files = grep /^html/, keys %file_map; ! my @html_dest_full = $self->_install_package_files_to_website( ! \@html_files ); ! ! my @widget_files = grep /^widget/, keys %file_map; ! my @widget_dest_files = @widget_files; ! s|^widget|template| for ( @widget_dest_files ); ! my @widget_dest_full = $self->_install_package_files_to_website( ! \@widget_files, \@widget_dest_files ); ! return [ @html_dest_full, @widget_dest_full ]; ! } ! ! ! sub _install_package_files_to_website { ! my ( $self, $base_files, $dest_files ) = @_; ! $log ||= get_logger( LOG_OI ); ! ! $dest_files ||= []; ! my $website_dir = $self->repository->website_dir; ! my $package_dir = rel2abs( $self->directory ); ! my $BACKUP_EXT = 'pkg_install_backup'; ! my ( @copy_files ); eval { ! my $count = 0; ! my %ro_by_dir = (); ! BASE_FILE: ! foreach my $from_base ( @{ $base_files } ) { ! ! # By default we copy relpath/filename -> relpath/filename ! # from $base_files unless something specified in ! # corresponding \@dest_files entry ! ! my $to_base = $dest_files->[ $count ] || $from_base; ! ! my $full_source_path = catfile( $package_dir, $from_base ); ! my $full_dest_path = catfile( $website_dir, $to_base ); ! $self->_create_full_path( $full_dest_path ); ! ! my $full_dest_dir = dirname( $full_dest_path ); ! my $ro = $ro_by_dir{ $full_dest_dir }; ! unless ( $ro ) { ! $ro_by_dir{ $full_dest_dir } = ! OpenInteract2::Config::Readonly->new( $full_dest_dir ); ! $ro = $ro_by_dir{ $full_dest_dir }; ! } ! ! # If file already exists check if we can write, and if so ! # backup the file ! ! if ( -f $full_dest_path ) { ! unless ( $ro->is_writeable( $to_base ) ) { ! $log->is_debug && ! $log->debug( "Will not copy '$full_source_path' ", ! "to '$full_dest_path': marked readonly" ); ! next BASE_FILE; ! } ! rename( $full_dest_path, "$full_dest_path.$BACKUP_EXT" ) ! || die "Cannot backup '$full_dest_path': $!"; ! } ! cp( $full_source_path, $full_dest_path ) ! || die "Cannot copy '$full_source_path' -> '$full_dest_path': $!"; ! chmod( 0666, $full_dest_path ); # let umask work... ! push @copy_files, $full_dest_path; ! $count++; ! } }; if ( $@ ) { $log->error( "Caught error copying files to website: $@" ); ! foreach my $filename ( @copy_files ) { unlink( $filename ) ! || warn "Cannot cleanup '$filename': $!"; ! if ( -f "$filename.$BACKUP_EXT" ) { ! rename( "$filename.$BACKUP_EXT", $filename ) || warn "Cannot activate backup for '$filename': $!"; ! unlink( "$filename.$BACKUP_EXT" ) || warn "Cannot remove stale backup for '$filename': $!"; } } ! @copy_files = (); } ! return \@copy_files; } ! ######################################## ! # PACKAGE SKELETON HELPERS ! # Must specify one of: ! # source_dir = /usr/local/src/OpenInteract-2.01 ! # sample_dir = /usr/local/src/OpenInteract-2.01/sample/package ! sub _skel_get_sample_dir { ! my ( $class, $params ) = @_; ! my $sample_dir = $params->{sample_dir}; ! my $source_dir = $params->{source_dir}; ! # If the source_dir is specified and the sample_dir isn't, build ! # the sample dir from the source dir ! if ( $source_dir && -d $source_dir && ! ( ! $sample_dir || ! -d $sample_dir ) ) { ! $sample_dir = catdir( $source_dir, 'sample', 'package' ); } ! if ( $sample_dir ) { ! $sample_dir = rel2abs( $sample_dir ); } ! unless ( $sample_dir && -d $sample_dir ) { ! oi_error "Specified sample directory '$sample_dir' is ", ! "not a valid directory"; } ! return $sample_dir; } # Ensure a package name is ok and that it can be used as a namespace # when necessary. --- 698,845 ---- } ! sub _install_html_and_widget_files_to_website { my ( $self ) = @_; ! my @pkg_files = @{ $self->get_files }; ! my %copy_files = (); ! for ( grep /^html/, @pkg_files ) { ! $log->is_debug && $log->debug( "Will copy HTML '$_' -> '$_'" ); ! $copy_files{ $_ } = $_; ! } ! foreach my $src ( grep /^widget/, @pkg_files ) { ! my $dest = $src; ! $dest =~ s|^widget|template|; ! $log->is_debug && $log->debug( "Will copy widget '$_' -> '$_'" ); ! $copy_files{ $src } = $dest; } ! my ( @copied ); eval { ! $self->_install_do_copy_files_to_website( \%copy_files, \@copied ); }; if ( $@ ) { $log->error( "Caught error copying files to website: $@" ); ! foreach my $filename ( @copied ) { unlink( $filename ) ! || warn "Cannot cleanup '$filename': $!"; ! if ( -f "$filename.backup" ) { ! rename( "$filename.backup", $filename ) || warn "Cannot activate backup for '$filename': $!"; ! unlink( "$filename.backup" ) || warn "Cannot remove stale backup for '$filename': $!"; } } ! @copied = (); } ! return @copied; } + sub _install_do_copy_files_to_website { + my ( $self, $copy_files, $track ) = @_; + my $website_dir = $self->repository->website_dir; + my $package_dir = rel2abs( $self->directory ); + my $count = 0; ! BASE_FILE: ! while ( my ( $src_base, $dest_base ) = each %{ $copy_files } ) { ! my $src_path = catfile( $package_dir, $src_base ); ! my $dest_path = catfile( $website_dir, $dest_base ); ! my $dest_dir = dirname( $dest_path ); ! $self->_create_full_path( $dest_path ); ! if ( -f $dest_path ) { ! my $dest_file = basename( $dest_path ); ! my $dest_dir = dirname( $dest_path ); ! my $ro = OpenInteract2::Config::Readonly->new( $dest_dir ); ! unless ( $ro->is_writeable( $dest_file ) ) { ! $log->is_info ! && $log->info( "Skipping '$dest_path' because it's marked as readonly" ); ! next BASE_FILE; ! } ! rename( $dest_path, "$dest_path.backup" ) ! || die "Cannot backup '$dest_path': $!\n"; ! } ! $log->is_debug && ! $log->debug( "Copying '$src_path' -> '$dest_path'" ); ! $self->_create_full_path( $dest_path ); ! cp( $src_path, $dest_path ) ! || die "Cannot copy '$src_path' -> '$dest_path': $!\n"; ! chmod( 0666, $dest_path ); # let umask work... ! push @{ $track }, $dest_path; ! $count++; ! } ! } ! sub _install_conf_files_to_website { ! my ( $self ) = @_; ! my $website_dir = $self->repository->website_dir; ! my $package_dir = rel2abs( $self->directory ); ! my $dest_conf_dir = catdir( $website_dir, 'conf', $self->name ); ! unless ( -d $dest_conf_dir ) { ! mkpath( $dest_conf_dir ); ! } ! my $dest_update_dir = catdir( $dest_conf_dir, 'updates' ); ! my @conf_files = grep /^conf/, @{ $self->get_files }; ! my @to_checksum = (); ! my %checksums = $self->_read_conf_checksums( $dest_conf_dir ); ! FILE: ! foreach my $src_base ( @conf_files ) { ! my $src_path = catfile( $package_dir, $src_base ); ! my $filename = basename( $src_path ); ! my $dest_path = catfile( $dest_conf_dir, $filename ); ! if ( -f $dest_path ) { ! my $md5 = OpenInteract2::Util->digest_file( $src_path ); ! next FILE if ( $checksums{ $filename } eq $md5 ); ! my $update_path = ! catfile( $dest_update_dir, $filename . '-' . $self->version ); ! $self->_create_full_path( $update_path ); ! cp( $src_path, $update_path ) ! || oi_error "Cannot copy $src_path -> $update_path: $!"; ! } ! else { ! cp( $src_path, $dest_path ) ! || oi_error "Cannot copy $src_path -> $dest_path: $!"; ! push @to_checksum, $filename; ! } } ! $self->_write_conf_checksums( $dest_conf_dir, @to_checksum ); ! } ! ! sub _read_conf_checksums { ! my ( $self, $conf_dir ) = @_; ! my $checksum_file = catfile( $conf_dir, 'CHECKSUMS' ); ! return () unless ( -f $checksum_file ); ! open( CSUM, '<', $checksum_file ) ! || oi_error "Cannot read from $checksum_file: $!"; ! my %sums = (); ! while ( <CSUM> ) { ! chomp; ! next if ( /^#/ or /^\s*$/ ); ! my ( $md5, $file ) = split /\s+/, $_, 2; ! $sums{ $file } = $md5; } ! close( CSUM ); ! return %sums; ! } ! ! sub _write_conf_checksums { ! my ( $self, $conf_dir, @files ) = @_; ! return unless ( scalar @files ); ! my $checksum_file = catfile( $conf_dir, 'CHECKSUMS' ); ! my $oper = ( -f $checksum_file ) ? '>>' : '>'; ! open( CSUM, $oper, $checksum_file ) ! || oi_error "Cannot write to $checksum_file: $!"; ! foreach my $file ( @files ) { ! my $md5 = OpenInteract2::Util->digest_file( catfile( $conf_dir, $file ) ); ! print CSUM "$md5 $file\n"; } ! close( CSUM ); } + + ######################################## + # PACKAGE SKELETON HELPERS + # Ensure a package name is ok and that it can be used as a namespace # when necessary. *************** *** 1329,1335 **** # You get back a reference to the installed package. ! my $package = OpenInteract2::Package->install( ! { package_file => '/home/perlguy/trivia-game-1.07.zip', ! website_dir => '/home/httpd/mysite' }); # Create a new skeleton package for development (for the real world, --- 1364,1371 ---- # You get back a reference to the installed package. ! my $package = OpenInteract2::Package->install({ ! package_file => '/home/perlguy/trivia-game-1.07.zip', ! website_dir => '/home/httpd/mysite' ! }); # Create a new skeleton package for development (for the real world, *************** *** 1337,1343 **** # package. ! my $package = OpenInteract2::Package->create_skeleton( ! { name => 'mynewpackage', ! sample_dir => '/usr/local/src/OpenInteract-2.00/sample/package' }); # Export package in the given directory for distribution --- 1373,1379 ---- # package. ! my $package = OpenInteract2::Package->create_skeleton({ ! name => 'mynewpackage', ! }); # Export package in the given directory for distribution *************** *** 1356,1360 **** 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", --- 1392,1397 ---- 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", *************** *** 1368,1372 **** my $package = OpenInteract2::Package->new({ ! directory => '/home/cwinters/pkg/mynewpackage' }); my @status = $package->check; foreach my $status ( @status ) { --- 1405,1410 ---- my $package = OpenInteract2::Package->new({ ! directory => '/home/cwinters/pkg/mynewpackage' ! }); my @status = $package->check; foreach my $status ( @status ) { *************** *** 1377,1381 **** my $package = OpenInteract2::Package->new({ ! directory => '/home/cwinters/pkg/mynewpackage' }); $package->remove; --- 1415,1420 ---- my $package = OpenInteract2::Package->new({ ! directory => '/home/httpd/mysite/pkg/mynewpackage-1.13', ! }); $package->remove; *************** *** 1492,1508 **** lower-case with no spaces. If not an exception is thrown. - =item * - - B<sample_dir>: The directory from where we pull our skeleton files - from. This is normally in the OpenInteract source distribution - directory, although you may elect to copy these files elsewhere so - developers can have access. - - =item * - - B<source_dir>: You can use this instead of C<sample_dir> as long as - the directory 'sample/package' exists underneath. (It should unless - you have mucked with the source distribution.) - =back --- 1531,1534 ---- *************** *** 1648,1653 **** B<get_spops_files()> ! Retrieves SPOPS configuration files from the package. You can either ! specify the files yourself in the package configuration (see L<OpenInteract2::Config::Package|OpenInteract2::Config::Package>), or this routine will pick up all files that match C<^conf/spops.*\.ini$>. --- 1674,1682 ---- B<get_spops_files()> ! Retrieves SPOPS configuration files used by this package. If the ! package object has an assigned C<repository> you'll get the files from ! C<$WEBSITE_DIR/conf/$PACKAGE>, otherwise they'll be from ! C<$PACKAGE_DIR/conf>. You can either specify the files yourself in the ! package configuration (see L<OpenInteract2::Config::Package|OpenInteract2::Config::Package>), or this routine will pick up all files that match C<^conf/spops.*\.ini$>. *************** *** 1657,1664 **** B<get_action_files()> ! Retrieves action configuration files from the package. You can either ! specify the files yourself in the package configuration (see L<OpenInteract2::Config::Package|OpenInteract2::Config::Package>), or ! this routine will pick up all files that match C<^conf/action.*\.ini$>. Returns: arrayref of relative action configuration files. --- 1686,1697 ---- B<get_action_files()> ! Retrieves action configuration files from the package. If the package ! object has an assigned C<repository> you'll get the files from ! C<$WEBSITE_DIR/conf/$PACKAGE>, otherwise they'll be from ! C<$PACKAGE_DIR/conf>. You can either specify the files yourself in the ! package configuration (see L<OpenInteract2::Config::Package|OpenInteract2::Config::Package>), or ! this routine will pick up all files that match ! C<^conf/action.*\.ini$>. Returns: arrayref of relative action configuration files. *************** *** 1688,1691 **** --- 1721,1728 ---- found, C<undef>. + NOTE: If you're looking for a configuration file use the + C<get_spops_files()> or C<get_action_files()> instead as you'll get + the most current version from the website with those. + B<read_file( $relative_file )> *************** *** 1720,1770 **** object associated with this package. - =head1 TO DO - - B<Automatically create objects for HTML pages> - - NEW WAY: - - In the relevant OI2::Manage class, just run the page scanner after a - package has been installed. - - OLD WAY: - - For each file copied over to the /html directory, create a 'page' - object in the system for it. Note that we might have to hook this up - with the system that ensures we do not overwrite certain files. So we - might need to either remove it from the _copy_package_files() routine, - or add an argument to that routine that lets us pass in a coderef to - execute with every item copied over. - - ACK -- here is the problem. We do not know if we can even create an $R - yet, because (1) the base_page package might not have even been - installed yet (when creating a website) and (2) the user has not yet - configured the database (etc.) - - We can get around this whenever we rewrite - Package/PackageRepository/oi_manage, but until then we will tell - people to include the relevant data inserts with packages that include - HTML documents. - - Until then, here is what this might look like :-) - - # Now do the HTML files, but also create records for each of the HTML - # files in the 'page' table - - my $copied = $class->_copy_package_files( "$info->{website_dir}/html", - 'html', - $pkg_file_list ); - my @html_locations = map { s/^html//; $_ } @{ $copied }; - foreach my $location ( @html_locations ) { - my $page = $R->page->fetch( $location, { skip_security => 1 } ); - next if ( $page ); - eval { - $R->page->new({ location => $location, - ... }) - ->save({ skip_security => 1 }); - }; - } - =head1 SEE ALSO --- 1757,1760 ---- |
From: Chris W. <la...@us...> - 2005-03-06 15:03:11
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23024/lib/OpenInteract2 Modified Files: CreateSecurity.pm Log Message: fix typo Index: CreateSecurity.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/CreateSecurity.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CreateSecurity.pm 4 Mar 2005 02:54:18 -0000 1.1 --- CreateSecurity.pm 6 Mar 2005 15:02:59 -0000 1.2 *************** *** 11,17 **** my @FIELDS = qw( ! scope scope_id level action spops where ! iterator website_dir num_processed num_failed ! start_time end_time elapsed_time ); __PACKAGE__->mk_accessors( @FIELDS ); --- 11,17 ---- my @FIELDS = qw( ! website_dir scope scope_id level ! action action_class spops spops_class where iterator ! num_processed num_failed start_time end_time elapsed_time ); __PACKAGE__->mk_accessors( @FIELDS ); *************** *** 97,124 **** } ! if ( my $spops_class = $self->spops ) { ! if ( ! $spops_class->can( 'fetch' ) ) { ! $errors{class} = "Class '$spops_class' is not valid. Are you " . "sure it is defined in your OpenInteract setup?"; ! } ! elsif ( ! $spops_class->isa( 'SPOPS::Secure' ) ) { ! $errors{class} = "Class '$spops_class' is not using security."; } } ! elsif ( my $action_class = $self->action ) { ! if ( ! UNIVERSAL::isa( $action_class, 'OpenInteract2::Action' ) ) { ! $errors{class} = ! "Class '$action_class' does not seem to be a ", ! "subclass of 'OpenInteract2::Action'."; } } else { ! $errors{class} = "Class not set, must be set to the class of " . ! "the object for which you want to set security " . ! "(e.g., 'OpenInteract2::News')"; } --- 97,146 ---- } ! if ( my $spops_key = $self->spops ) { ! my $spops_class = eval { CTX->lookup_object( $spops_key ) }; ! if ( $spops_class ) { ! if ( ! $spops_class->can( 'fetch' ) ) { ! $errors{spops} = "Class '$spops_class' is not valid. Are you " . "sure it is defined in your OpenInteract setup?"; ! } ! elsif ( ! $spops_class->isa( 'SPOPS::Secure' ) ) { ! $errors{spops} = "Class '$spops_class' is not using security."; + } + else { + $self->spops_class( $spops_class ); + } + } + else { + $errors{spops} = + "Cannot find SPOPS class mapped to key '$spops_key'"; } } ! elsif ( my $action_name = $self->action ) { ! my $info = eval { CTX->lookup_action_info( $action_name ) }; ! if ( $info->{class} ) { ! if ( ! UNIVERSAL::isa( $info->{class}, 'OpenInteract2::Action' ) ) { ! $errors{action} = ! "Class '$info->{class}' does not seem to be a " . ! "subclass of 'OpenInteract2::Action'."; ! } ! else { ! $self->action_class( $info->{class} ); ! } ! ! } ! else { ! $errors{action} = ! "Cannot find action mapped to name '$action_name'"; } } else { ! $errors{class} = ! "Neither action name nor SPOPS key set. One must be set to " . ! "the class for which you want to set security (e.g., " . ! "'OpenInteract2::Action::News', 'OpenInteract2::News')"; } *************** *** 150,154 **** my ( $count, $failure ) = ( 0, 0 ); ! if ( my $spops_class = $self->spops ) { my ( $object_store ); if ( $self->iterator eq 'yes' ) { --- 172,176 ---- my ( $count, $failure ) = ( 0, 0 ); ! if ( my $spops_class = $self->spops_class ) { my ( $object_store ); if ( $self->iterator eq 'yes' ) { *************** *** 175,179 **** } ! elsif ( my $action_class = $self->action ) { my $ok = _create_or_update_security( $scope, $scope_id, $level, $action_class, '0', --- 197,201 ---- } ! elsif ( my $action_class = $self->action_class ) { my $ok = _create_or_update_security( $scope, $scope_id, $level, $action_class, '0', *************** *** 321,326 **** --- 343,352 ---- B<action> + B<action_class> (assigned after C<validate()>) + B<spops> + B<spops_class> (assigned after C<validate()>) + B<where> *************** *** 339,345 **** =head1 SEE ALSO ! L<OpenInteract2::Manage::Website::CreateSecurity> ! L<OpenInteract2::Manage::Website::CreateActionSecurity> =head1 COPYRIGHT --- 365,371 ---- =head1 SEE ALSO ! L<OpenInteract2::Manage::Website::CreateSecurityForAction> ! L<OpenInteract2::Manage::Website::CreateSecurityForSPOPS> =head1 COPYRIGHT |
From: Chris W. <la...@us...> - 2005-03-04 20:48:52
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10814/t Modified Files: manage_list_objects.t Log Message: cleaned up a little Index: manage_list_objects.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/manage_list_objects.t,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** manage_list_objects.t 4 Mar 2005 20:34:06 -0000 1.8 --- manage_list_objects.t 4 Mar 2005 20:48:41 -0000 1.9 *************** *** 8,11 **** --- 8,35 ---- use Test::More tests => 43; + + my %OBJECTS = ( + comment => 'Comment', + comment_disable => 'CommentDisable', + comment_notify => 'CommentNotify', + comment_summary => 'CommentSummary', + content_type => 'ContentType', + full_text_mapping => 'FullTextMapping', + group => 'Group', + news => 'News', + news_section => 'NewsSection', + object_action => 'ObjectAction', + page => 'Page', + page_content => 'PageContent', + page_directory => 'PageDirectory', + security => 'Security', + theme => 'Theme', + themeprop => 'ThemeProp', + user => 'User', + user_language => 'UserLanguage', + whats_new => 'WhatsNew', + ); + + require_ok( 'OpenInteract2::Manage' ); *************** *** 21,43 **** 'Task of correct class' ); my @status = eval { $task->execute }; ok( ! $@, 'Task executed ok' ); ! is( scalar @status, 18, 'Correct number of SPOPS objects listed' ); ! my @names = qw( ! comment comment_disable comment_notify comment_summary content_type ! full_text_mapping group news news_section object_action page page_content ! page_directory security theme themeprop user user_language whats_new ! ); ! my @classes = map { "OpenInteract2::$_" } qw( ! Comment CommentDisable CommentNotify CommentSummary ContentType ! FullTextMapping Group News NewsSection ObjectAction Page PageContent ! PageDirectory Security Theme ThemeProp User UserLanguage WhatsNew ! ); ! for ( my $i = 0; $i < scalar @names; $i++ ) { ! is( $status[$i]->{name}, $names[$i], ! "Object " . ($i + 1) . " name correct ($names[$i])" ); ! is( $status[$i]->{class}, $classes[$i], ! "Object " . ($i + 1) . " class correct ($classes[$i])" ); } --- 45,60 ---- 'Task of correct class' ); + my @status = eval { $task->execute }; ok( ! $@, 'Task executed ok' ); ! is( scalar @status, scalar keys %OBJECTS, 'Correct number of SPOPS objects listed' ); ! my @ordered = sort keys %OBJECTS; ! for ( my $i = 0; $i < scalar @ordered; $i++ ) { ! is( $status[$i]->{name}, $ordered[$i], ! "Object " . ($i + 1) . " name correct ($ordered[$i])" ); ! my $class_name = 'OpenInteract2::' . $OBJECTS{ $ordered[ $i ] }; ! is( $status[$i]->{class}, $class_name, ! "Object " . ($i + 1) . " class correct ($class_name)" ); } |
From: Chris W. <la...@us...> - 2005-03-04 20:34:14
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6528 Modified Files: context.t manage_list_actions.t manage_list_objects.t Log Message: reflect added SPOPS/action from comments Index: context.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/context.t,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** context.t 4 Mar 2005 03:46:21 -0000 1.45 --- context.t 4 Mar 2005 20:34:06 -0000 1.46 *************** *** 80,84 **** is( ref $action_table, 'HASH', 'Action table is correct data structure' ); ! is( scalar keys %{ $action_table }, 44, 'Correct number of actions in table' ); --- 80,84 ---- is( ref $action_table, 'HASH', 'Action table is correct data structure' ); ! is( scalar keys %{ $action_table }, 45, 'Correct number of actions in table' ); *************** *** 156,160 **** is( ref $spops_config, 'HASH', 'SPOPS config is correct data structure' ); ! is( scalar keys %{ $spops_config }, 18, 'Correct number of SPOPS configs in structure' ); --- 156,160 ---- is( ref $spops_config, 'HASH', 'SPOPS config is correct data structure' ); ! is( scalar keys %{ $spops_config }, 19, 'Correct number of SPOPS configs in structure' ); Index: manage_list_actions.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/manage_list_actions.t,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** manage_list_actions.t 2 Mar 2005 15:42:13 -0000 1.9 --- manage_list_actions.t 4 Mar 2005 20:34:06 -0000 1.10 *************** *** 6,10 **** use lib 't/'; require 'utils.pl'; ! use Test::More tests => 49; require_ok( 'OpenInteract2::Manage' ); --- 6,10 ---- use lib 't/'; require 'utils.pl'; ! use Test::More tests => 50; require_ok( 'OpenInteract2::Manage' ); *************** *** 25,29 **** my @names = qw( ! admin_tools_box boxes comment comment_recent content_type edit_document_box error_browser file_index forgotpassword group latest_news login_box logout lookups new new_comment_form --- 25,29 ---- my @names = qw( ! admin_tools_box boxes comment comment_admin comment_recent content_type edit_document_box error_browser file_index forgotpassword group latest_news login_box logout lookups new new_comment_form Index: manage_list_objects.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/manage_list_objects.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** manage_list_objects.t 25 Feb 2005 05:32:48 -0000 1.7 --- manage_list_objects.t 4 Mar 2005 20:34:06 -0000 1.8 *************** *** 6,10 **** use lib 't/'; require 'utils.pl'; ! use Test::More tests => 41; require_ok( 'OpenInteract2::Manage' ); --- 6,10 ---- use lib 't/'; require 'utils.pl'; ! use Test::More tests => 43; require_ok( 'OpenInteract2::Manage' ); *************** *** 27,36 **** my @names = qw( ! comment comment_notify comment_summary content_type full_text_mapping group news news_section object_action page page_content page_directory security theme themeprop user user_language whats_new ); my @classes = map { "OpenInteract2::$_" } qw( ! Comment CommentNotify CommentSummary ContentType FullTextMapping Group News NewsSection ObjectAction Page PageContent PageDirectory Security Theme ThemeProp User UserLanguage WhatsNew --- 27,36 ---- my @names = qw( ! comment comment_disable comment_notify comment_summary content_type full_text_mapping group news news_section object_action page page_content page_directory security theme themeprop user user_language whats_new ); my @classes = map { "OpenInteract2::$_" } qw( ! Comment CommentDisable CommentNotify CommentSummary ContentType FullTextMapping Group News NewsSection ObjectAction Page PageContent PageDirectory Security Theme ThemeProp User UserLanguage WhatsNew |
From: Chris W. <la...@us...> - 2005-03-04 20:26:56
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4062 Modified Files: build_bricks Log Message: update generated brick name Index: build_bricks =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/build_bricks,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** build_bricks 17 Feb 2005 04:58:55 -0000 1.8 --- build_bricks 4 Mar 2005 20:26:48 -0000 1.9 *************** *** 112,116 **** my %pkg_brick_base = ( brick_dir => 'pkg', ! brick_name => 'App%s', brick_summary => "Base-64 encoded OI2 package '%s' shipped with distribution", brick_example => 'oi2_manage create_website --website_dir=/path/to/site', --- 112,116 ---- my %pkg_brick_base = ( brick_dir => 'pkg', ! brick_name => '%s', brick_summary => "Base-64 encoded OI2 package '%s' shipped with distribution", brick_example => 'oi2_manage create_website --website_dir=/path/to/site', *************** *** 123,127 **** my $cc_base_name = ucfirst( $base_name ); $cc_base_name =~ s/_(\w)/uc($1)/ge; ! my $pkg_brick_name = "pkg_$base_name"; $pkg_brick{brick_name} = sprintf( $pkg_brick{brick_name}, $cc_base_name ); $pkg_brick{lc_brick_name} = $pkg_brick_name; --- 123,127 ---- my $cc_base_name = ucfirst( $base_name ); $cc_base_name =~ s/_(\w)/uc($1)/ge; ! my $pkg_brick_name = $base_name; $pkg_brick{brick_name} = sprintf( $pkg_brick{brick_name}, $cc_base_name ); $pkg_brick{lc_brick_name} = $pkg_brick_name; |
From: Chris W. <la...@us...> - 2005-03-04 15:22:58
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846/OpenInteract2/Action Modified Files: Comments.pm Added Files: CommentAdmin.pm Log Message: OIN-119: be able to disable comments for an individual object or for an entire class of objects -- new action (comment_admin) as well as SPOPS object (comment_disable) --- NEW FILE: CommentAdmin.pm --- package OpenInteract2::Action::CommentAdmin; # $Id: CommentAdmin.pm,v 1.1 2005/03/04 15:22:10 lachoy Exp $ use strict; use base qw( OpenInteract2::Action ); $OpenInteract2::Action::CommentAdmin::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); sub list { my ( $self ) = @_; my $disabled = OpenInteract2::CommentDisable->fetch_group({ order => 'disabled_on DESC', }); return $self->generate_content({ disabled_list => $disabled }); } sub disable { my ( $self ) = @_; $self->param_from_request( 'class', 'object_id' ); my $c_class = $self->param( 'class' ); if ( $c_class ) { my $id = $self->param( 'object_id' ); eval { OpenInteract2::CommentDisable->disable( $c_class, $id ) }; if ( $@ ) { $self->add_error_key( 'comments.error.add_disable', "$@" ); } else { $id ||= 'ALL'; $self->add_status_key( 'comments.status.add_disable_ok', $c_class, $id ); } } else { $self->add_error_key( 'comments.error.disable_no_class' ); } return $self->execute({ task => 'list' }); } sub enable { my ( $self ) = @_; my $disable_id = $self->param( 'disable_id' ); my ( $c_class, $c_id, $error ); if ( $disable_id ) { eval { my $disable = OpenInteract2::CommentDisable->fetch( $disable_id ); $c_class = $disable->{class}; $c_id = $disable->{object_id}; $disable->remove(); }; if ( $@ ) { $error = $@; } } else { $self->param_from_request( 'class', 'object_id' ); $c_class = $self->param( 'class' ); if ( $c_class ) { $c_id = $self->param( 'object_id' ); eval { OpenInteract2::CommentDisable->enable( $c_class, $c_id ) }; if ( $@ ) { $error = $@; } else { $self->add_error_key( 'comments..error.remove_disable_no_class' ); } } } if ( $error ) { $self->add_error_key( 'comments.error.remove_disable', "$@" ); } elsif ( $c_class ) { $c_id ||= 'ALL'; $self->add_status_key( 'comments.status.remove_disable_ok', $c_class, $c_id ); } return $self->execute({ task => 'list' }); } 1; Index: Comments.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/OpenInteract2/Action/Comments.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Comments.pm 3 Mar 2005 13:08:57 -0000 1.14 --- Comments.pm 4 Mar 2005 15:22:10 -0000 1.15 *************** *** 26,34 **** $log ||= get_logger( LOG_APP ); ! my $object = $self->param( 'object' ); ! my $obj_class = $self->param( 'class' ); ! my $obj_id = $self->param( 'object_id' ); ! ! unless ( $object and ! ( $obj_class and $obj_id ) ) { $log->warn( "Cannot display summary: no object or ", "object class + ID given" ); --- 26,31 ---- $log ||= get_logger( LOG_APP ); ! my ( $obj_class, $obj_id ) = $self->_get_class_and_id; ! unless ( $obj_class and $obj_id ) { $log->warn( "Cannot display summary: no object or ", "object class + ID given" ); *************** *** 38,46 **** my %params = (); - # This doesn't HAVE to be a commentable object, so... - - $obj_class ||= ref $object; - $obj_id ||= $object->id; - $log->is_debug && $log->debug( "Fetching summary for '$obj_class: $obj_id'" ); --- 35,38 ---- *************** *** 48,52 **** OpenInteract2::CommentSummary->fetch_group({ where => 'class = ? AND object_id = ?', ! value => [ $obj_class, scalar $obj_id ], }) }; --- 40,44 ---- OpenInteract2::CommentSummary->fetch_group({ where => 'class = ? AND object_id = ?', ! value => [ $obj_class, $obj_id ], }) }; *************** *** 66,72 **** num_comments => 0, class => $obj_class, ! obj_id => $obj_id }); ! $object = eval { $obj_class->fetch( $obj_id ) }; if ( $@ ) { $log->error( "FAILURE: Cannot fetch for summary object ", --- 58,64 ---- num_comments => 0, class => $obj_class, ! object_id => $obj_id }); ! my $object = eval { $obj_class->fetch( $obj_id ) }; if ( $@ ) { $log->error( "FAILURE: Cannot fetch for summary object ", *************** *** 151,175 **** $log ||= get_logger( LOG_APP ); ! my $object = $self->param( 'object' ); ! my $request = CTX->request; ! if ( $object ) { ! $log->is_debug && ! $log->debug( "Object passed in to display comments: ", ! "[", ref( $object ), ": ", $object->id, "]" ); } ! else { ! $log->is_debug && ! $log->debug( "Object not passed in, using class and object_id ", ! "from action or request params" ); ! my $obj_class = $self->param( 'class' ) || ! $request->param( 'class' ); ! my $obj_id = $self->param( 'object_id' ) || ! $request->param( 'object_id' ); ! unless ( $obj_class and $obj_id ) { ! $log->error( 'Class/object_id not given to find object' ); ! return $self->_msg( 'comments.error.list_for_object_data_missing' ); ! } ! $object = eval { $obj_class->fetch( $obj_id ) }; if ( $@ ) { --- 143,157 ---- $log ||= get_logger( LOG_APP ); ! $self->param_from_request( 'class', 'object_id' ); ! my ( $obj_class, $obj_id ) = $self->_get_class_and_id(); ! unless ( $obj_class and $obj_id ) { ! $log->error( 'Class/object_id not given to find object' ); ! return $self->_msg( 'comments.error.list_for_object_data_missing' ); } ! $log->is_debug && ! $log->debug( "Will display comments for [$obj_class: $obj_id]" ); ! my $object = $self->param( 'object' ); ! unless ( $object ) { $object = eval { $obj_class->fetch( $obj_id ) }; if ( $@ ) { *************** *** 186,190 **** OpenInteract2::Comment->fetch_group({ where => 'class = ? and object_id = ?', ! value => [ ref $object, scalar( $object->id ) ], order => 'posted_on ASC' }) --- 168,172 ---- OpenInteract2::Comment->fetch_group({ where => 'class = ? and object_id = ?', ! value => [ $obj_class, $obj_id ], order => 'posted_on ASC' }) *************** *** 301,313 **** sub show_empty_form { my ( $self ) = @_; ! my $comment = $self->_fill_in_default_comment(); ! my $has_cookie = $self->_has_cookie(); ! my $is_subscribed = ( $has_cookie ) ! ? $self->_is_subscribed( $comment ) : 0; ! my %params = ( ! comment => $comment, ! remember_poster => $has_cookie ? 'yes' : '', ! is_subscribed => $is_subscribed ? 'yes' : 'no', ); return $self->generate_content( \%params, { name => 'comments::comment_form' } ); --- 283,308 ---- sub show_empty_form { my ( $self ) = @_; ! $log ||= get_logger( LOG_APP ); ! my ( $object_class, $object_id ) = $self->_get_class_and_id(); ! my %params = (); ! $params{is_disabled} = OpenInteract2::CommentDisable->is_disabled( ! $object_class, $object_id, ); + if ( $params{is_disabled} ) { + $log->is_info && + $log->info( "Comments are disabled for [$object_class $object_id] ", + "(may be all objects in class are disabled)" ); + } + else { + $params{comment} = $self->_fill_in_default_comment(); + $params{has_cookie} = $self->_has_cookie() ? 'yes' : 'no'; + if ( $params{has_cookie} ) { + $params{is_subscribed} = + $self->_is_subscribed( $params{comment} ) ? 'yes' : 'no'; + } + else { + $params{is_subscribed} = 'no'; + } + } return $self->generate_content( \%params, { name => 'comments::comment_form' } ); *************** *** 343,358 **** } my $object = $self->param( 'object' ); if ( $object ) { ! $comment->{class} = ref $object; ! $comment->{object_id} = $object->id; } else { ! $comment->{class} = $self->param( 'class' ); ! $comment->{object_id} = $self->param( 'object_id' ); } ! return $comment; } sub _get_cookie_name { my ( $self ) = @_; --- 338,363 ---- } + my ( $o_class, $o_id ) = $self->_get_class_and_id(); + $comment->{class} = $o_class; + $comment->{object_id} = $o_id; + return $comment; + } + + sub _get_class_and_id { + my ( $self ) = @_; my $object = $self->param( 'object' ); + my ( $o_class, $o_id ); if ( $object ) { ! $o_class = ref $object; ! $o_id = $object->id; } else { ! $o_class = $self->param( 'class' ); ! $o_id = $self->param( 'object_id' ); } ! return ( $o_class, $o_id ); } + sub _get_cookie_name { my ( $self ) = @_; |
From: Chris W. <la...@us...> - 2005-03-04 15:22:56
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846/data Modified Files: install_security.dat Log Message: OIN-119: be able to disable comments for an individual object or for an entire class of objects -- new action (comment_admin) as well as SPOPS object (comment_disable) Index: install_security.dat =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/data/install_security.dat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** install_security.dat 24 Nov 2003 22:34:37 -0000 1.2 --- install_security.dat 4 Mar 2005 15:22:11 -0000 1.3 *************** *** 4,8 **** field_order => [ qw/ class object_id scope scope_id security_level / ], transform_default_to_id => [ 'scope_id' ], }, ! [ 'OpenInteract2::Action::Comments', 0, 'w', 'world', 4 ], ! [ 'OpenInteract2::Action::Comments', 0, 'g', 'site_admin_group', 8 ], ]; --- 4,10 ---- field_order => [ qw/ class object_id scope scope_id security_level / ], transform_default_to_id => [ 'scope_id' ], }, ! [ 'OpenInteract2::Action::Comments', 0, 'w', 'world', 4 ], ! [ 'OpenInteract2::Action::Comments', 0, 'g', 'site_admin_group', 8 ], ! [ 'OpenInteract2::Action::CommentAdmin', 0, 'w', 'world', 0 ], ! [ 'OpenInteract2::Action::CommentAdmin', 0, 'g', 'site_admin_group', 8 ], ]; |
From: Chris W. <la...@us...> - 2005-03-04 15:22:56
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/OpenInteract2/SQLInstall In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846/OpenInteract2/SQLInstall Modified Files: Comments.pm Log Message: OIN-119: be able to disable comments for an individual object or for an entire class of objects -- new action (comment_admin) as well as SPOPS object (comment_disable) Index: Comments.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/OpenInteract2/SQLInstall/Comments.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Comments.pm 22 May 2004 01:45:24 -0000 1.4 --- Comments.pm 4 Mar 2005 15:22:11 -0000 1.5 *************** *** 6,20 **** use base qw( OpenInteract2::SQLInstall ); my %FILES = ( ! default => [ 'comment.sql', 'comment_notify.sql', 'comment_summary.sql' ], ib => [ 'comment_interbase.sql', 'comment_generator.sql', ! 'comment_notify.sql', 'comment_notify_generator.sql', ! 'comment_summary.sql', 'comment_summary_generator.sql' ], ! oracle => [ 'comment_oracle.sql', 'comment_sequence.sql', ! 'comment_notify_oracle.sql', 'comment_notify_sequence.sql', ! 'comment_summary_oracle.sql', 'comment_summary_sequence.sql' ], ! pg => [ 'comment.sql', 'comment_sequence.sql', ! 'comment_notify.sql', 'comment_notify_sequence.sql', ! 'comment_summary.sql', 'comment_summary_sequence.sql' ], ); --- 6,26 ---- use base qw( OpenInteract2::SQLInstall ); + my @tables = qw( + comment.sql comment_notify.sql + comment_summary.sql comment_disable.sql + ); + my @sequences = qw( + comment_sequence.sql comment_notify_sequence.sql + comment_summary_sequence.sql comment_disable_sequence.sql + ); my %FILES = ( ! default => [ @tables ], ! oracle => [ 'comment_oracle.sql', 'comment_summary_oracle.sql', ! 'comment_notify_oracle.sql', 'comment_disable.sql', ! @sequences ], ! pg => [ @tables, @sequences ], ib => [ 'comment_interbase.sql', 'comment_generator.sql', ! 'comment_notify.sql', 'comment_notify_generator.sql', ! 'comment_summary.sql', 'comment_summary_generator.sql' ], ); |
From: Chris W. <la...@us...> - 2005-03-04 15:22:55
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846/conf Modified Files: action.ini Added Files: spops_comment_disable.ini Log Message: OIN-119: be able to disable comments for an individual object or for an entire class of objects -- new action (comment_admin) as well as SPOPS object (comment_disable) --- NEW FILE: spops_comment_disable.ini --- [comment_disable] class = OpenInteract2::CommentDisablePersist alias_class = OpenInteract2::CommentDisable isa = field = field_discover = yes id_field = disable_id increment_field = yes is_secure = no is_searchable = no sequence_name = oi_comment_disable_seq no_insert = disable_id skip_undef = @,no_update = disable_id, class, object_id base_table = oi_comment_disable sql_defaults = object_name = Comment disable name = disable_id Index: action.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/conf/action.ini,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** action.ini 3 Mar 2005 13:02:55 -0000 1.6 --- action.ini 4 Mar 2005 15:22:11 -0000 1.7 *************** *** 33,36 **** --- 33,44 ---- is_secure = no + [comment_admin] + class = OpenInteract2::Action::CommentAdmin + is_secure = yes + task_default = list + security = WRITE + url_additional = disable_id + template_source = comments::disable_list + [comment_recent] class = OpenInteract2::Action::Comments *************** *** 40,41 **** --- 48,50 ---- default_comment_count = 5 url_none = yes + cache_expire = 30m \ No newline at end of file |
From: Chris W. <la...@us...> - 2005-03-04 15:22:51
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846 Modified Files: Changes MANIFEST package.ini Log Message: OIN-119: be able to disable comments for an individual object or for an entire class of objects -- new action (comment_admin) as well as SPOPS object (comment_disable) Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/Changes,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Changes 3 Mar 2005 13:09:12 -0000 1.20 --- Changes 4 Mar 2005 15:22:09 -0000 1.21 *************** *** 1,7 **** Revision history for OpenInteract package comments. 1.22 Wed Mar 2 23:47:36 EST 2005 ! OIN-112: change the 'email on new thread?' a dropdown and modify the language for the labels based on whether you're already subscribed; deciding to unsubscribe from the thread will remove --- 1,14 ---- Revision history for OpenInteract package comments. + 1.23 Fri Mar 4 00:27:21 EST 2005 + + OIN-119: add new action 'comment_admin' so you can disable + comments or entire classes of comments and include 'is_disabled' + function so we can check whether we should display a new comment + form. + 1.22 Wed Mar 2 23:47:36 EST 2005 ! OIN-112: change the 'email on new thread?' to a dropdown and modify the language for the labels based on whether you're already subscribed; deciding to unsubscribe from the thread will remove Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/MANIFEST,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MANIFEST 1 Mar 2005 03:28:41 -0000 1.4 --- MANIFEST 4 Mar 2005 15:22:09 -0000 1.5 *************** *** 5,8 **** --- 5,9 ---- conf/action.ini conf/spops_comment.ini + conf/spops_comment_disable.ini conf/spops_comment_notify.ini conf/spops_comment_summary.ini *************** *** 10,16 **** --- 11,19 ---- msg/comments-messages-en.msg OpenInteract2/Comment.pm + OpenInteract2/CommentDisable.pm OpenInteract2/CommentSummarySync.pm OpenInteract2/Commentable.pm OpenInteract2/Action/Comments.pm + OpenInteract2/Action/CommentAdmin.pm OpenInteract2/App/Comments.pm OpenInteract2/SQLInstall/Comments.pm *************** *** 20,23 **** --- 23,28 ---- struct/comment_oracle.sql struct/comment_sequence.sql + struct/comment_disable.sql + struct/comment_disable_sequence.sql struct/comment_notify.sql struct/comment_notify_generator.sql *************** *** 39,41 **** --- 44,47 ---- template/comment_poster.tmpl template/comment_summary.tmpl + template/disable_list.tmpl template/notification_email.tmpl \ No newline at end of file Index: package.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/package.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** package.ini 3 Mar 2005 13:09:12 -0000 1.3 --- package.ini 4 Mar 2005 15:22:09 -0000 1.4 *************** *** 1,5 **** [package] name = comments ! version = 1.22 author = Chris Winters <ch...@cw...> url = http://www.cwinters.com/ --- 1,5 ---- [package] name = comments ! version = 1.23 author = Chris Winters <ch...@cw...> url = http://www.cwinters.com/ |
From: Chris W. <la...@us...> - 2005-03-04 15:22:29
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846/template Modified Files: comment_form.tmpl Added Files: disable_list.tmpl Log Message: OIN-119: be able to disable comments for an individual object or for an entire class of objects -- new action (comment_admin) as well as SPOPS object (comment_disable) --- NEW FILE: disable_list.tmpl --- [%- title = MSG( 'comments.disable_list.title' ); OI.page_title( title ); -%] [%- PROCESS error_message; PROCESS status_message; -%] <h2>[% title %]</h2> [% IF disabled_list.size > 0 %] [% INCLUDE table_bordered_begin -%] [% INCLUDE header_row( label_keys = [ 'comments.disable.date', 'comments.disable.title', 'comments.disable.class', 'comments.disable.id', 'global.label.nbsp', ] ) -%] [% FOREACH item = disabled_list %] [% enable_url = OI.make_url( ACTION = 'comment_admin', TASK = 'enable', URL_PARAMS = item.id ) %] <tr [% PROCESS row_color( count = loop.count ) %]> <td>[% OI.date_format( item.disabled_on, '%Y-%m-%d' ) %]</td> <td> [%- IF item.object_url -%] <a href="[% item.object_url %]">[% item.object_title %]</a> [%- ELSE -%] [% item.object_title %] [%- END -%] </td> <td>[% item.class %]</td> <td>[% item.object_id %]</td> <td><a href="[% enable_url %]">[% MSG( 'comments.disable.enable' ) %]</td> </tr> [% END %] [% INCLUDE table_bordered_end -%] [% ELSE %] <p>[% MSG( 'comments.disable_list.no_disabled' ) %]</p> [% END %] <h3>[% MSG( 'comments.disable.form_title' ) %]</h3> <p>[% MSG( 'comments.disable.form_summary' ) %]</p> [% INCLUDE form_begin( ACTION = 'comment_admin', TASK = 'disable', method = 'GET' ) %] [% INCLUDE table_bordered_begin -%] [% INCLUDE label_form_text_row( label_key = 'comments.disable.class', name = 'class', size = '40' ) %] [% INCLUDE label_form_text_row( label_key = 'comments.disable.id', name = 'object_id', size = '40' ) %] [% INCLUDE form_submit_row( value_key = 'comments.disable.disable' ) %] [% INCLUDE table_bordered_end %] [% INCLUDE form_end %] Index: comment_form.tmpl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/template/comment_form.tmpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** comment_form.tmpl 3 Mar 2005 13:04:38 -0000 1.4 --- comment_form.tmpl 4 Mar 2005 15:22:12 -0000 1.5 *************** *** 2,5 **** --- 2,11 ---- PROCESS error_message -%] + [% IF is_disabled %] + + <p align="center"><b>[% MSG( 'comments.disabled' ) %]</b></p> + + [% ELSE %] + <h2>[% MSG( 'comments.form.title' ) %]</h2> *************** *** 110,112 **** </form> ! </div> \ No newline at end of file --- 116,120 ---- </form> ! </div> ! ! [% END %] \ No newline at end of file |
From: Chris W. <la...@us...> - 2005-03-04 15:22:26
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/struct In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846/struct Added Files: comment_disable.sql comment_disable_sequence.sql Log Message: OIN-119: be able to disable comments for an individual object or for an entire class of objects -- new action (comment_admin) as well as SPOPS object (comment_disable) --- NEW FILE: comment_disable.sql --- CREATE TABLE oi_comment_disable ( disable_id %%INCREMENT%%, disabled_on %%DATETIME%% not null, class varchar(75) not null, object_id varchar(255) not null, object_url varchar(75) not null, object_title varchar(150) not null, primary key( disable_id ), unique( class, object_id ) ) --- NEW FILE: comment_disable_sequence.sql --- CREATE SEQUENCE oi_comment_disable_seq |
From: Chris W. <la...@us...> - 2005-03-04 15:22:20
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/msg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846/msg Modified Files: comments-messages-en.msg Log Message: OIN-119: be able to disable comments for an individual object or for an entire class of objects -- new action (comment_admin) as well as SPOPS object (comment_disable) Index: comments-messages-en.msg =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/msg/comments-messages-en.msg,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** comments-messages-en.msg 3 Mar 2005 13:07:38 -0000 1.9 --- comments-messages-en.msg 4 Mar 2005 15:22:11 -0000 1.10 *************** *** 3,6 **** --- 3,7 ---- comments.no_comment = No comment to display. comments.no_comments = No comments to display. + comments.form.title = Post a comment comments.form.no_html = (No HTML; '<ecode></ecode>' preformats; http:// autocreates links.) *************** *** 15,18 **** --- 16,20 ---- comments.form_page.title = Comments comments.form_page.title_preview = Preview + comments.info.name = Name comments.info.email = E-Mail *************** *** 26,29 **** --- 28,32 ---- comments.info.object = Comments on: [_1] comments.info.unknown_object = an unknown object. + comments.list_page.title = Comments comments.list_page.overview = Latest comments from [_1] to [_2] out of [_3]. *************** *** 31,34 **** --- 34,38 ---- comments.list_page.next_link = Next comments.list_page.no_comments = No comments available. + comments.notify_list.title = Comment Notifications comments.notify_list.summary_thread = The following people have been asked to be notified \ *************** *** 37,46 **** --- 41,74 ---- for a thread I cannot determine. comments.notify_list.no_notifications = Nobody has asked to be notified. + comments.summary.error = Error summarizing comments comments.summary = <a href="[_1]">Comments? ([_2])</a> comments.notify.new_comment = A new comment has been posted on [_1] + + comments.disabled = New comments are disabled. + + comments.disable_list.title = Disabled Comment Threads + comments.disable_list.no_disabled = No objects or object classes have been disabled. + comments.disable.disable = Disable + comments.disable.enable = Enable + comments.disable.date = Disable Date + comments.disable.class = Class + comments.disable.id = Object ID + comments.disable.title = Title + comments.disable.form_title = Disable a Thread + comments.disable.form_summary = Specify an object for which I should disable comments. \ + If you leave the 'Object ID' blank all objects of the specified class will have them disabled. + comments.error.disable_no_class = You must provide a class for which I should disable comments. + comments.error.add_disable = Failed to disable: [_1] + comments.status.add_disable_ok = Disabled comments on class [_1] with ID [_2]. + comments.error.remove_disable_no_class = You must provide a class for which I should enable comments. + comments.error.remove_disable = Failed to remove disable on comments: [_1] + comments.status.remove_disable_ok = Removed disable for comments on class [_1] with ID [_2]. + + comments.status.add_ok = Comment successfully added. comments.status.add_notify_ok = Your notification for this thread added successfully. comments.status.remove_notify_ok = Your notification for this thread removed successfully. + comments.error.data_missing = Data are required for the following fields: [_1] comments.error.cannot_fetch = Error fetching comment: [_1] |
From: Chris W. <la...@us...> - 2005-03-04 15:22:19
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846/OpenInteract2 Added Files: CommentDisable.pm Log Message: OIN-119: be able to disable comments for an individual object or for an entire class of objects -- new action (comment_admin) as well as SPOPS object (comment_disable) --- NEW FILE: CommentDisable.pm --- package OpenInteract2::CommentDisable; # $Id: CommentDisable.pm,v 1.1 2005/03/04 15:22:10 lachoy Exp $ use strict; use OpenInteract2::Context qw( CTX ); @OpenInteract2::CommentDisable::ISA = qw( OpenInteract2::CommentDisablePersist ); $OpenInteract2::CommentDisable::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); use constant ALL_ID => 'ALL'; sub is_disabled { my ( $class, $check_class, $check_id ) = @_; my $item = $class->_get_disabled_item( $check_class, $check_id ); return $item; } sub disable { my ( $class, $check_class, $check_id ) = @_; my $item = $class->_get_disabled_item( $check_class, $check_id ); unless ( $item ) { my ( $title, $url ) = ( 'n/a', '' ); if ( $check_id ) { my $object = eval { $check_class->fetch( $check_id ) }; unless ( $@ ) { my $info = $object->object_description; $title = $info->{title}; $url = $info->{url}; } } $check_id ||= ALL_ID; $item = $class->new({ class => $check_class, object_id => $check_id, object_title => $title, object_url => $url, disabled_on => CTX->create_date(), })->save(); } return $item ; } sub enable { my ( $class, $check_class, $check_id ) = @_; my $item = $class->_get_disabled_item( $check_class, $check_id ); if ( $item ) { $item->remove(); } } sub _get_disabled_item { my ( $class, $check_class, $check_id ) = @_; my ( $where ); my @values = ( $check_class ); if ( $check_id ) { $where = 'class = ? AND ( object_id = ? OR object_id = ? )'; push @values, $check_id, ALL_ID; } else { $where = 'class = ? AND object_id = ?'; push @values, ALL_ID; } my $items = $class->fetch_group({ where => $where, value => \@values, }); return ( ref $items eq 'ARRAY' and scalar @{ $items } > 0 ) ? $items->[0] : undef; } 1; |
From: Chris W. <la...@us...> - 2005-03-04 03:50:14
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24409/t Added Files: manage_create_action_security.t manage_create_spops_security.t Removed Files: manage_create_security.t Log Message: replace old test with new ones (that do just as little) for spops + action --- NEW FILE: manage_create_action_security.t --- # -*-perl-*- # $Id: manage_create_action_security.t,v 1.1 2005/03/04 03:49:44 lachoy Exp $ use strict; use lib 't/'; require 'utils.pl'; use Test::More tests => 2; require_ok( 'OpenInteract2::Manage' ); my $task = OpenInteract2::Manage->new( 'secure_action' ); is( ref $task, 'OpenInteract2::Manage::Website::CreateSecurityForAction', 'Task created' ); --- NEW FILE: manage_create_spops_security.t --- # -*-perl-*- # $Id: manage_create_spops_security.t,v 1.1 2005/03/04 03:49:44 lachoy Exp $ use strict; use lib 't/'; require 'utils.pl'; use Test::More tests => 2; require_ok( 'OpenInteract2::Manage' ); my $task = OpenInteract2::Manage->new( 'secure_spops' ); is( ref $task, 'OpenInteract2::Manage::Website::CreateSecurityForSPOPS', 'Task created' ); --- manage_create_security.t DELETED --- |
From: Chris W. <la...@us...> - 2005-03-04 03:50:09
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24409 Modified Files: MANIFEST Log Message: replace old test with new ones (that do just as little) for spops + action Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/MANIFEST,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** MANIFEST 1 Mar 2005 03:31:40 -0000 1.118 --- MANIFEST 4 Mar 2005 03:49:44 -0000 1.119 *************** *** 263,267 **** t/manage_clean_sessions.t t/manage_create_password.t ! t/manage_create_security.t t/manage_export_package.t t/manage_install_all_sql.t --- 263,268 ---- t/manage_clean_sessions.t t/manage_create_password.t ! t/manage_create_action_security.t ! t/manage_create_spops_security.t t/manage_export_package.t t/manage_install_all_sql.t |
From: Chris W. <la...@us...> - 2005-03-04 03:46:46
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23672/t Modified Files: context.t manage_list_packages.t Log Message: fix typos Index: context.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/context.t,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** context.t 4 Mar 2005 03:11:21 -0000 1.44 --- context.t 4 Mar 2005 03:46:21 -0000 1.45 *************** *** 70,74 **** foreach my $pkg_name ( get_packages() ) { ! is( ref( $repository->fetch_package( $pkg_name ) ), 'OpenInteract2::Package' "Package '$pkg_name' exists" ); } --- 70,74 ---- foreach my $pkg_name ( get_packages() ) { ! is( ref( $repository->fetch_package( $pkg_name ) ), 'OpenInteract2::Package', "Package '$pkg_name' exists" ); } Index: manage_list_packages.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/manage_list_packages.t,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** manage_list_packages.t 4 Mar 2005 03:11:21 -0000 1.14 --- manage_list_packages.t 4 Mar 2005 03:46:21 -0000 1.15 *************** *** 6,10 **** use lib 't/'; require 'utils.pl'; ! use Test::More tests => 23; require_ok( 'OpenInteract2::Manage' ); --- 6,10 ---- use lib 't/'; require 'utils.pl'; ! use Test::More tests => 21; require_ok( 'OpenInteract2::Manage' ); |
From: Chris W. <la...@us...> - 2005-03-04 03:36:23
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21698 Modified Files: Initializer.pm Log Message: fix typo... Index: Initializer.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config/Initializer.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Initializer.pm 4 Mar 2005 02:51:45 -0000 1.21 --- Initializer.pm 4 Mar 2005 03:35:56 -0000 1.22 *************** *** 367,371 **** my ( $verbose ) = @_; if ( $verbose =~ /^(NONE|SUMMARY|READ|WRITE)$/i ) { ! $verbose = OpenInteract2::Util->verbose_to_level( uc $task_security ); } return int( $verbose ); --- 367,371 ---- my ( $verbose ) = @_; if ( $verbose =~ /^(NONE|SUMMARY|READ|WRITE)$/i ) { ! $verbose = OpenInteract2::Util->verbose_to_level( uc $verbose ); } return int( $verbose ); |