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-27 19:00:49
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3820/pkg/base_template Modified Files: Changes package.conf Log Message: add changes + package version updates for Salve's changes Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_template/Changes,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Changes 14 Jul 2004 03:21:04 -0000 1.13 --- Changes 27 Nov 2004 19:00:28 -0000 1.14 *************** *** 1,4 **** --- 1,9 ---- Revision history for OpenInteract package base_template. + 3.13 Wed Nov 24 10:01:32 EST 2004 + + Add check in OI2::SiteTemplate->_lookup_package_template_dir to + ensure we get a valid package from the repository. + 3.12 Tue Jul 13 23:19:13 EDT 2004 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_template/package.conf,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** package.conf 14 Jul 2004 03:21:04 -0000 1.14 --- package.conf 27 Nov 2004 19:00:28 -0000 1.15 *************** *** 1,4 **** name base_template ! version 3.12 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ --- 1,4 ---- name base_template ! version 3.13 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ |
From: Chris W. <la...@us...> - 2004-11-27 19:00:48
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3820/pkg/base_user Modified Files: Changes package.conf Log Message: add changes + package version updates for Salve's changes Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_user/Changes,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Changes 13 Jun 2004 19:42:21 -0000 1.33 --- Changes 27 Nov 2004 19:00:29 -0000 1.34 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package base_user. + 2.33 Sat Nov 27 13:51:04 EST 2004 + + Add Norwegian messages from Salve Nilsen. + 2.32 Sun Jun 13 15:35:14 EDT 2004 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_user/package.conf,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** package.conf 13 Jun 2004 19:42:21 -0000 1.33 --- package.conf 27 Nov 2004 19:00:30 -0000 1.34 *************** *** 1,4 **** name base_user ! version 2.32 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ --- 1,4 ---- name base_user ! version 2.33 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ |
From: Chris W. <la...@us...> - 2004-11-27 19:00:48
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_group In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3820/pkg/base_group Modified Files: Changes package.conf Log Message: add changes + package version updates for Salve's changes Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_group/Changes,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Changes 13 Jun 2004 19:42:01 -0000 1.15 --- Changes 27 Nov 2004 19:00:28 -0000 1.16 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package base_group. + 2.15 Sat Nov 27 13:51:04 EST 2004 + + Add Norwegian messages from Salve Nilsen. + 2.14 Sun Jun 13 15:32:23 EDT 2004 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_group/package.conf,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** package.conf 13 Jun 2004 19:42:01 -0000 1.15 --- package.conf 27 Nov 2004 19:00:28 -0000 1.16 *************** *** 1,4 **** name base_group ! version 2.14 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ --- 1,4 ---- name base_group ! version 2.15 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ |
From: Chris W. <la...@us...> - 2004-11-27 19:00:40
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_box In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3820/pkg/base_box Modified Files: Changes package.conf Log Message: add changes + package version updates for Salve's changes Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/Changes,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Changes 24 Oct 2004 15:03:00 -0000 1.16 --- Changes 27 Nov 2004 19:00:28 -0000 1.17 *************** *** 1,4 **** --- 1,11 ---- Revision history for OpenInteract package base_box. + 2.16 Sat Nov 27 13:51:04 EST 2004 + + From Salve Nilsen: + - add Norwegian messages + - let site admins see the templates_used_box by default, in + addition to the admin_tools_box. + 2.15 Sun Oct 24 11:01:44 EDT 2004 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/package.conf,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** package.conf 24 Oct 2004 15:03:00 -0000 1.15 --- package.conf 27 Nov 2004 19:00:28 -0000 1.16 *************** *** 1,4 **** name base_box ! version 2.15 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ --- 1,4 ---- name base_box ! version 2.16 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ |
From: Chris W. <la...@us...> - 2004-11-27 18:24:51
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11157/conf Modified Files: action.ini Log Message: add all_tags_box; ensure message keys for box titles match up; ensure 'tagged_objects' isn't URL-accessible Index: action.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/conf/action.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** action.ini 25 Nov 2004 03:54:56 -0000 1.3 --- action.ini 27 Nov 2004 17:12:05 -0000 1.4 *************** *** 6,11 **** url_none = yes weight = 2 ! title_key = tags.related_tags.title ! title = Related Tags # meant to be used as component --- 6,18 ---- url_none = yes weight = 2 ! title_key = tags.related_tags_box.title ! ! [all_tags_box] ! class = OpenInteract2::Action::DeliciousTags ! task = all_tags ! is_secure = no ! url_none = yes ! weight = 2 ! title_key = tags.all_tags_box.title # meant to be used as component *************** *** 14,17 **** --- 21,25 ---- task = tagged_objects is_secure = no + url_none = yes template_source = delicious_tags::tagged_objects |
From: Chris W. <la...@us...> - 2004-11-27 18:16:22
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25943 Modified Files: Changes Log Message: add a couple of SPAN tags Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/Changes,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Changes 27 Nov 2004 18:05:23 -0000 1.7 --- Changes 27 Nov 2004 18:16:13 -0000 1.8 *************** *** 3,7 **** 0.09 Sat Nov 27 13:01:42 EST 2004 ! Add docs to OI2::DeliciousTag and modify some internals. 0.08 Sat Nov 27 11:26:54 EST 2004 --- 3,8 ---- 0.09 Sat Nov 27 13:01:42 EST 2004 ! Add docs to OI2::DeliciousTag and modify some internals; also ! add some style tags to the display items. 0.08 Sat Nov 27 11:26:54 EST 2004 |
From: Chris W. <la...@us...> - 2004-11-27 18:05:37
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23507 Modified Files: package.conf MANIFEST Changes Log Message: metadata Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/package.conf,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** package.conf 25 Nov 2004 13:50:33 -0000 1.6 --- package.conf 27 Nov 2004 18:05:23 -0000 1.7 *************** *** 1,4 **** name delicious_tags ! version 0.07 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ --- 1,4 ---- name delicious_tags ! version 0.09 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/MANIFEST,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MANIFEST 25 Nov 2004 03:55:41 -0000 1.5 --- MANIFEST 27 Nov 2004 18:05:23 -0000 1.6 *************** *** 16,19 **** --- 16,20 ---- OpenInteract2/SQLInstall/DeliciousTags.pm template/related_tags.tmpl + template/tag_listing.tmpl template/tagged_objects.tmpl template/tagged_objects_page.tmpl Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/Changes,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Changes 25 Nov 2004 13:50:33 -0000 1.6 --- Changes 27 Nov 2004 18:05:23 -0000 1.7 *************** *** 1,4 **** --- 1,16 ---- Revision history for OpenInteract2 package delicious_tags. + 0.09 Sat Nov 27 13:01:42 EST 2004 + + Add docs to OI2::DeliciousTag and modify some internals. + + 0.08 Sat Nov 27 11:26:54 EST 2004 + + Add 'all_tags_box' action; move tag listing to separate template + (template/tag_listing.tmpl) to be invoked as component; add more + docs to doc/delicious_tags.pod, including how to get tags into + and out of the system; add all messages (including errors) to + message file. + 0.07 Thu Nov 25 08:46:02 EST 2004 |
From: Chris W. <la...@us...> - 2004-11-27 18:05:26
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23428/OpenInteract2 Modified Files: DeliciousTag.pm Log Message: add docs and modify some internals, including the 'hash_option' everywhere where we fetch tags and counts together Index: DeliciousTag.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/DeliciousTag.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DeliciousTag.pm 25 Nov 2004 03:14:04 -0000 1.3 --- DeliciousTag.pm 27 Nov 2004 18:05:10 -0000 1.4 *************** *** 16,19 **** --- 16,21 ---- sub add_tags { my ( $class, $object_type, $object_id, $url, $name, @tags ) = @_; + + # first delete all tags for this type and ID... $class->db_delete({ table => $class->table_name, *************** *** 21,24 **** --- 23,28 ---- value => [ $object_type, $object_id ], }); + + # ..then add all the given tags so there's no overlap foreach my $tag ( @tags ) { $class->new({ *************** *** 37,44 **** my $tags = $class->db_select({ select_modifier => 'DISTINCT', ! select => [ 'tag' ], ! from => [ $class->table_name ], ! order => 'tag', ! return => 'single-list', }); return $tags; --- 41,48 ---- my $tags = $class->db_select({ select_modifier => 'DISTINCT', ! select => [ 'tag' ], ! from => [ $class->table_name ], ! order => 'tag', ! return => 'single-list', }); return $tags; *************** *** 46,50 **** sub fetch_all_tags_with_count { ! my ( $class, $option ) = @_; my $counts = $class->db_select({ select => [ 'tag', 'count(*)' ], --- 50,54 ---- sub fetch_all_tags_with_count { ! my ( $class, $hash_option ) = @_; my $counts = $class->db_select({ select => [ 'tag', 'count(*)' ], *************** *** 53,57 **** group => 'tag', }); ! return $counts; } --- 57,61 ---- group => 'tag', }); ! return $class->_translate_tag_and_count( $counts, $hash_option ); } *************** *** 69,72 **** --- 73,88 ---- } + sub fetch_tags_with_count_for_object { + my ( $class, $object_type, $object_id, $hash_option ) = @_; + $log ||= get_logger( LOG_APP ); + my $tags = $class->fetch_tags_for_object( $object_type, $object_id ) || []; + $log->is_info && + $log->info( "For [$object_type: $object_id] got ", + "tags: ", join( ', ', @{ $tags } ) ); + return ( scalar @{ $tags } ) + ? $class->_fetch_counts_for_tags( $tags, $hash_option ) + : []; + } + # Return all objects that have a given tag in \@tags; we uniq-ify them *************** *** 75,84 **** sub fetch_tag_objects { my ( $class, $tags, $skip_type, $skip_id ) = @_; ! my $where = $class->_create_or_clause_for_tags( @{ $tags } ); ! my @values = @{ $tags }; if ( $skip_type and $skip_id ) { $where .= ' AND ( object_type != ? AND object_id != ? )'; push @values, $skip_type, $skip_id; } my $tag_objects = $class->fetch_group({ where => $where, --- 91,107 ---- sub fetch_tag_objects { my ( $class, $tags, $skip_type, $skip_id ) = @_; ! $log ||= get_logger( LOG_APP ); ! my ( $where, $tag_values ) = $class->_create_or_clause_for_tags( $tags ); ! $log->is_debug && ! $log->debug( "Finding objects tagged with: ", join( ', ', @{ $tag_values } ) ); ! my @values = @{ $tag_values }; if ( $skip_type and $skip_id ) { $where .= ' AND ( object_type != ? AND object_id != ? )'; push @values, $skip_type, $skip_id; } + elsif ( $skip_type ) { + $where .= ' AND $object_type != ? '; + push @values, $skip_type; + } my $tag_objects = $class->fetch_group({ where => $where, *************** *** 86,89 **** --- 109,115 ---- order => 'object_type', }); + $log->is_debug && + $log->debug( "Found ", scalar @{ $tag_objects }, " items; now ", + "finding unique objects..." ); my @uniq_tag_objects = (); my %seen = (); *************** *** 94,112 **** push @uniq_tag_objects, $tag_object; } return \@uniq_tag_objects; } - sub fetch_tags_with_count_for_object { - my ( $class, $object_type, $object_id ) = @_; - $log ||= get_logger( LOG_APP ); - my $tags = $class->fetch_tags_for_object( $object_type, $object_id ) || []; - $log->is_info && - $log->info( "For [$object_type: $object_id] got ", - "tags: ", join( ', ', @{ $tags } ) ); - return ( scalar @{ $tags } ) - ? $class->_fetch_counts_for_tags( $tags ) - : []; - } - sub fetch_count { my ( $class, $tag ) = @_; --- 120,128 ---- push @uniq_tag_objects, $tag_object; } + $log->is_debug && + $log->debug( "Found ", scalar @uniq_tag_objects, " unique items" ); return \@uniq_tag_objects; } sub fetch_count { my ( $class, $tag ) = @_; *************** *** 124,128 **** my ( $class, @base_tags ) = @_; my $table = $class->table_name; ! my $base_where = $class->_create_or_clause_for_tags( @base_tags ); my $sql = qq{ SELECT d2.tag --- 140,144 ---- my ( $class, @base_tags ) = @_; my $table = $class->table_name; ! my ( $base_where, $tag_values ) = $class->_create_or_clause_for_tags( \@base_tags ); my $sql = qq{ SELECT d2.tag *************** *** 135,139 **** my $tags = $class->db_select({ sql => $sql, ! value => \@base_tags, return => 'single-list', }); --- 151,155 ---- my $tags = $class->db_select({ sql => $sql, ! value => $tag_values, return => 'single-list', }); *************** *** 142,173 **** sub fetch_related_tags_with_count { ! my ( $class, $base_tag ) = @_; ! my $tags = $class->fetch_related_tags( $base_tag ); ! return $class->_fetch_counts_for_tags( $tags ); } sub _fetch_counts_for_tags { ! my ( $class, $tags ) = @_; ! my $where = $class->_create_or_clause_for_tags( @{ $tags } ); my $counts = $class->db_select({ select => [ 'tag', 'count(*)' ], from => [ $class->table_name ], where => $where, ! value => $tags, group => 'tag', }); ! return $counts; } sub _create_or_clause_for_tags { ! my ( $class, @tags ) = @_; $log ||= get_logger( LOG_APP ); - my $clause = '(' . join( ' OR ', map { 'tag = ?' } grep { $_ } @tags ) . ')'; $log->is_info && $log->info( "Created WHERE clause '$clause' for ", ! "tags: ",join( ', ', @tags ) ); ! return $clause; } 1; --- 158,394 ---- sub fetch_related_tags_with_count { ! my ( $class, @tags_and_option ) = @_; ! my $hash_option = ( ref $tags_and_option[-1] eq 'HASH' ) ! ? pop @tags_and_option : undef; ! my $tags = $class->fetch_related_tags( @tags_and_option ); ! return $class->_fetch_counts_for_tags( $tags, $hash_option ); } sub _fetch_counts_for_tags { ! my ( $class, $tags, $hash_option ) = @_; ! my ( $where, $tag_values ) = $class->_create_or_clause_for_tags( $tags ); my $counts = $class->db_select({ select => [ 'tag', 'count(*)' ], from => [ $class->table_name ], where => $where, ! value => $tag_values, group => 'tag', }); ! return $class->_translate_tag_and_count( $counts, $hash_option ); ! } ! ! sub _translate_tag_and_count { ! my ( $class, $counts, $hash_option ) = @_; ! if ( ref $hash_option eq 'HASH' ) { ! my @records = (); ! foreach my $rec ( @{ $counts } ) { ! push @records, { tag => $rec->[0], count => $rec->[1] }; ! } ! return \@records; ! } ! else { ! return $counts; ! } } + # $tags can be simple scalar, arrayref of simple scalars, or + # potentially an arrayref of arrayrefs + sub _create_or_clause_for_tags { ! my ( $class, $tags ) = @_; ! ! # flatten out $tags into a simple list ! my @all_tags = (); ! my @use_tags = ( ref $tags ) ? @{ $tags } : $tags; ! foreach my $use_tag ( @use_tags ) { ! push @all_tags, ref( $use_tag ) ? @{ $use_tag } : split /\s+/, $use_tag; ! } ! ! my $clause = '(' . join( ' OR ', map { 'tag = ?' } grep { $_ } @all_tags ) . ')'; $log ||= get_logger( LOG_APP ); $log->is_info && $log->info( "Created WHERE clause '$clause' for ", ! "tags: ",join( ', ', @all_tags ) ); ! return ( $clause, \@all_tags ); } 1; + + __END__ + + =head1 NAME + + OpenInteract2::DeliciousTag - SPOPS class for tags + + =head1 SYNOPSIS + + my $tag_class = CTX->lookup_object( 'delicious_tag' ); + + my $tags = $tag_class->fetch_all_tags; + print "Current tags: ", join( ", ", @{ $tags } ); + + my $tags_and_count = $tag_class->fetch_all_tags_and_count; + print "Current tags:\n"; + foreach my $tag_and_count( @{ $tags_with_count } ) { + print " - $tag_and_count->[0]: $tag_and_count->[1]\n"; + } + + # ...same but each tag + count returned as hashref + my $tags_and_count = $tag_class->fetch_all_tags_and_count( {} ); + print "Current tags:\n"; + foreach my $tag_and_count( @{ $tags_with_count } ) { + print " - $tag_and_count->{tag}: $tag_and_count->{count}\n"; + } + + my $news_id = $news->id; + my $tags = $tag_class->fetch_tags_for_object( 'News', $news_id); + print "Tags for news ID $news_id: ", join( ", ", @{ $tags } ); + + my $tags_and_count = $tag_class->fetch_tags_with_count_for_object( 'News', $news_id ); + print "Tags with count for news ID $news_id:\n"; + foreach my $tag_and_count( @{ $tags_with_count } ) { + print " - $tag_and_count->[0]: $tag_and_count->[1]\n"; + } + + # ...same but each tag + count as hashref + my $tags_and_count = $tag_class->fetch_tags_with_count_for_object( 'News', $news_id, {} ); + print "Tags with count for news ID $news_id:\n"; + 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"; + } + + # Find all the OpenInteract2::DeliciousTag objects tagged with + # 'linux' + my $items = $tag_class->fetch_tag_objects( 'linux' ); + + # Find all the OpenInteract2::DeliciousTag objects tagged with + # 'linux' or 'win32' + my $items = $tag_class->fetch_tag_objects( [ 'linux', 'win32' ] ); + + # Find all the OpenInteract2::DeliciousTag objects tagged with + # 'linux' or 'win32' that aren't of the 'blog' type + my $items = $tag_class->fetch_tag_objects( [ 'linux', 'win32' ], 'blog' ); + + # Find all the OpenInteract2::DeliciousTag objects tagged with + # 'linux' or 'win32' that aren't of the 'blog' type with ID '35' + my $items = $tag_class->fetch_tag_objects( [ 'linux', 'win32' ], 'blog', '35' ); + + # Display the OpenInteract2::DeliciousTag objects + foreach my $item ( @{ $items } ) { + my $full_url = OpenInteract2::URL->create( $item->{url} ); + print "Item type: $item->{object_type} with ID $item->{object_id}\n", + " Name: $item->{name}\n", + " URL: $full_url\n"; + } + + =head1 DESCRIPTION + + This is the SPOPS class for storing and retrieving tags. It has a + number of useful class methods to get interesting data out of the + system. + + =head1 CLASS METHODS + + B<add_tags( $object_type, $object_id, $url, $name, @tags )> + + Adds a tag record with C<$object_type>, C<$object_id>, C<$url> (which + will not be modified), C<$name> for each of C<@tags>. + + B<fetch_all_tags()> + + Returns: arrayref of strings, one for each distinct tag in system + + B<fetch_all_tags_with_count( [ \%hash_option ] )> + + Returns: an arrayref of records indicating a tag and the number of + objects tagged by it; if C<\%hash_option> given each record is an + arrayref with the keys 'tag' and 'count'; if it's not given each + record is an arrayref with element 0 as the tag and element 1 as the + count. + + B<fetch_tags_for_object( $object_type, $object_id )> + + Returns: arrayref of strings, one of each distinct tag used by the + object with type C<$object_type> and ID C<$object_id>. + + B<fetch_tags_with_count_for_object( $object_type, $object_id, [ \%hash_option ] )> + + Returns: arrayref of records, one of each distinct tag used by the + object with type C<$object_type> and ID C<$object_id>; if + C<\%hash_option> given each record is an arrayref with the keys 'tag' + and 'count'; if it's not given each record is an arrayref with element + 0 as the tag and element 1 as the count. + + B<fetch_tag_objects( $tags | \@tags, [ $skip_object_type, $skip_object_id ] )> + + Find out what objects have any of a given set of tags. If an object + has multiple of the given tags it's only returned once. + + If given C<$tags> as a simple scalar we C<split()> on C<\s+> before + submitting. + + If given C<$skip_object_type> we don't return objects with this + 'object_type' property. + + If also given C<$skip_object_id> we don't return objects with this + 'object_type' property and with this 'object_id' property. + + Returns: arrayref of distinct L<OpenInteract2::DeliciousTag> objects + matching the given criteria. + + B<fetch_count( $tag )> + + Returns: number of objects with the given tag. + + B<fetch_related_tags( @tags )> + + Returns: arrayref of strings, one for each distinct tag used by + objects tagged by one of C<@tags> but not in C<@tags>. + + B<fetch_related_tags_with_count( @tags, \%hash_option )> + + Returns: arrayref of records, one for each distinct tag used by + objects tagged by one of C<@tags> but not in C<@tags>; if + C<\%hash_option> given each record is an arrayref with the keys 'tag' + and 'count'; if it's not given each record is an arrayref with element + 0 as the tag and element 1 as the count. + + =head1 OBJECT METHODS + + None in this class; see L<SPOPS::DBI> for basic object persistence. + + =head1 SEE ALSO + + L<OpenInteract2::DeliciousTaggableObject>: To call some of these + methods in relation to another object. + + L<OpenInteract2::Observer::AddDeliciousTags>: Which adds tags based on + object adds/updates. + + =head1 COPYRIGHT + + Copyright (c) 2004 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> |
From: Chris W. <la...@us...> - 2004-11-27 18:04:43
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23210/doc Modified Files: delicious_tags.pod Log Message: change how the class is referenced in SYNOPSIS Index: delicious_tags.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/doc/delicious_tags.pod,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** delicious_tags.pod 27 Nov 2004 17:10:55 -0000 1.5 --- delicious_tags.pod 27 Nov 2004 18:04:24 -0000 1.6 *************** *** 59,76 **** " Tag: $info->{tag}; URL: $url\n"; } - - - # These are class methods we cleverly disguise as being called from - # an object without state because it's less typing... ! my $tagger = OpenInteract2::DeliciousTag->new; # Fetch available tags ! my $tags = $tagger->fetch_all_tags; print "Available tags: ", join( ', ', @{ $tags } ); # Fetch available tags with the number of objects in each ! my $tags_and_counts = $tagger->fetch_all_tags_with_count; foreach my $tag_and_count( @{ $tags_with_count } ) { print "$tag_and_count->[0]: $tag_and_count->[1]\n"; --- 59,74 ---- " 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"; *************** *** 78,82 **** # You can also fetch as an arrayref of hashrefs ! my $tags_and_counts = $tagger->fetch_all_tags_with_count( {} ); foreach my $tag_and_count( @{ $tags_with_count } ) { print "$tag_and_count->{tag}: $tag_and_count->{count}\n"; --- 76,80 ---- # 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"; *************** *** 84,98 **** # Fetch a count by tag ! my $count = $tagger->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 = $tagger->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 = $tagger->fetch_related_tags_with_count( 'sometag' ); foreach my $tag_and_count( @{ $tags_with_count } ) { print " - $tag_and_count->{tag}: $tag_and_count->{count}\n"; --- 82,96 ---- # 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"; |
From: Chris W. <la...@us...> - 2004-11-27 17:13:31
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11435/OpenInteract2/Action Modified Files: DeliciousTags.pm Log Message: add 'all_tags' task; use message keys for error strings Index: DeliciousTags.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Action/DeliciousTags.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DeliciousTags.pm 25 Nov 2004 13:50:32 -0000 1.3 --- DeliciousTags.pm 27 Nov 2004 17:13:07 -0000 1.4 *************** *** 12,15 **** --- 12,24 ---- $OpenInteract2::Action::DeliciousTags::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); + sub all_tags { + my ( $self ) = @_; + my $tag_class = CTX->lookup_object( 'delicious_tag' ); + my $tags = $tag_class->fetch_all_tags_with_count(); + return $self->generate_content( + { tag_and_count => $tags }, + { name => 'delicious_tags::tag_listing' }); + } + sub related_tags { my ( $self ) = @_; *************** *** 56,60 **** else { $self->param_add( ! error_msg => "Must specify 'tag' to find related objects" ); } return \%params; --- 65,69 ---- else { $self->param_add( ! error_msg => $self->_msg( 'tags.error.related_objects_no_tag' ) ); } return \%params; |
From: Chris W. <la...@us...> - 2004-11-27 17:12:40
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Observer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11251/OpenInteract2/Observer Modified Files: AddDeliciousTags.pm Log Message: ensure we only get a string or arrayref Index: AddDeliciousTags.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Observer/AddDeliciousTags.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AddDeliciousTags.pm 25 Nov 2004 03:14:04 -0000 1.3 --- AddDeliciousTags.pm 27 Nov 2004 17:12:31 -0000 1.4 *************** *** 39,46 **** return; } ! my $object_desc = ref( $object ) . ': ' . $object->id; $log->is_info && ! $log->info( "Will add tags '$tag_listing' to '$object_desc'" ); ! my @all_tags = split /\s+/, $tag_listing; OpenInteract2::DeliciousTaggableObject::add_tags( $object, @all_tags ); } --- 39,55 ---- return; } ! my $listing_type = ref $tag_listing; ! if ( $listing_type and $listing_type ne 'ARRAY' ) { ! $log->warn( "Given a tag listing of type '$listing_type'", ! "$action_desc; I only know how to process a ", ! "space-delimited string or an arrayref of strings." ); ! return; ! } ! my @all_tags = ( $listing_type eq 'ARRAY' ) ! ? @{ $tag_listing } ! : split /\s+/, $tag_listing; $log->is_info && ! $log->info( "Will add tags '", join( ', ', @all_tags ), "' ", ! "to '", ref( $object ), ': ', eval { $object->id }, "'" ); OpenInteract2::DeliciousTaggableObject::add_tags( $object, @all_tags ); } *************** *** 63,67 **** # Mark your action 'myaction' to be observed and have the tags from ! # 'tags' mapped to your object [map] --- 72,76 ---- # Mark your action 'myaction' to be observed and have the tags from ! # the request or action parameter 'tags' mapped to your object [map] *************** *** 105,108 **** --- 114,119 ---- L<OpenInteract2::DeliciousTag> + L<OpenInteract2::DeliciousTaggableObject> + =head1 COPYRIGHT |
From: Chris W. <la...@us...> - 2004-11-27 17:11:09
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10760/doc Modified Files: delicious_tags.pod Log Message: docs, docs and more docs Index: delicious_tags.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/doc/delicious_tags.pod,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** delicious_tags.pod 25 Nov 2004 13:50:32 -0000 1.4 --- delicious_tags.pod 27 Nov 2004 17:10:55 -0000 1.5 *************** *** 98,103 **** 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: --- 98,102 ---- 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: *************** *** 112,120 **** An earlier version of this same idea was available in the OpenInteract ! 1.x package C<object_link> but it was much heavier and 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 ! anything like that. =head1 OBJECTS --- 111,227 ---- 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/?id=" . $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 *************** *** 122,132 **** L<delicious_tag> =head1 ACTIONS B<related_tags_box> ! Box to display the tags (and the number of other objects tagged by ! them) related to a particular object. You need to pass in an 'object' ! or 'c_object' for it to work: [% OI.box_add( 'related_tags_box', object = news ) %] --- 229,250 ---- 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 ) %] *************** *** 135,139 **** Component to display items given a particular tag. You can invoke this ! anywhere: <p> --- 253,257 ---- Component to display items given a particular tag. You can invoke this ! anywhere, such as: <p> *************** *** 143,148 **** B<tags> ! Currently has single task 'show_tagged_items' which displays a ! full-page version of the 'tagged_items' action. =head1 OBSERVERS --- 261,266 ---- B<tags> ! Currently has single URL-accessible task 'show_tagged_items' which ! displays a full-page version of the 'tagged_items' action. =head1 OBSERVERS |
From: Chris W. <la...@us...> - 2004-11-27 17:08:54
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/msg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9991/msg Modified Files: delicious_tags-en.msg Log Message: add error message; ensure all names matchup Index: delicious_tags-en.msg =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/msg/delicious_tags-en.msg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** delicious_tags-en.msg 24 Oct 2004 16:40:08 -0000 1.1 --- delicious_tags-en.msg 27 Nov 2004 17:07:56 -0000 1.2 *************** *** 1 **** ! tags.related_tags.title = Related Tags \ No newline at end of file --- 1,4 ---- ! tags.related_tags_box.title = Related Tags ! tags.no_related_tags = No related tags. ! tags.all_tags_box.title = All Tags ! tags.error.related_objects_no_tag = Must specify 'tag' to find related objects. \ No newline at end of file |
From: Chris W. <la...@us...> - 2004-11-27 17:07:56
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9915/template Modified Files: related_tags.tmpl Log Message: move the tag listing out into a separate component and INCLUDE Index: related_tags.tmpl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/template/related_tags.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** related_tags.tmpl 25 Nov 2004 03:54:27 -0000 1.2 --- related_tags.tmpl 27 Nov 2004 17:07:31 -0000 1.3 *************** *** 1,10 **** [% IF tag_and_count.size > 0 %] ! [% FOREACH tag_count = tag_and_count; ! tagged_objects_url = OI.make_url( ACTION = 'tags', ! TASK = 'show_tagged_objects', ! tag = tag_count.0 ); %] ! o <a href="[% tagged_objects_url %]">[% tag_count.0 %]</a> ([% tag_count.1 %]) <br /> ! [% END %] [% ELSE %] ! No related tags. [% END %] \ No newline at end of file --- 1,5 ---- [% IF tag_and_count.size > 0 %] ! [% INCLUDE delicious_tags::tag_listing %] [% ELSE %] ! [% MSG( 'tags.no_related_tags' ) %] [% END %] \ No newline at end of file |
From: Chris W. <la...@us...> - 2004-11-27 17:07:30
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9837/template Added Files: tag_listing.tmpl Log Message: move tag listing into separate component --- NEW FILE: tag_listing.tmpl --- [% FOREACH tag_count = tag_and_count; tagged_objects_url = OI.make_url( ACTION = 'tags', TASK = 'show_tagged_objects', tag = tag_count.0 ); %] o <a href="[% tagged_objects_url %]">[% tag_count.0 %]</a> ([% tag_count.1 %]) <br /> [% END %] |
From: Salve J. N. <sj...@us...> - 2004-11-25 17:34:00
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/wiki/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16661/extra_packages/wiki/OpenInteract2/Action Modified Files: Wiki.pm Log Message: Fix a comparison bug Index: Wiki.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/wiki/OpenInteract2/Action/Wiki.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Wiki.pm 3 Jun 2004 20:32:59 -0000 1.2 --- Wiki.pm 25 Nov 2004 17:33:50 -0000 1.3 *************** *** 203,207 **** ( $wiki_action, $node ) = @action_items; } ! elsif ( $num_items = 1 ) { if ( $ACTIONS{ $action_items[0] } ) { ( $wiki_action, $node ) = ( $action_items[0], undef ); --- 203,207 ---- ( $wiki_action, $node ) = @action_items; } ! elsif ( $num_items == 1 ) { if ( $ACTIONS{ $action_items[0] } ) { ( $wiki_action, $node ) = ( $action_items[0], undef ); |
From: Chris W. <la...@us...> - 2004-11-25 13:50:42
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31922 Modified Files: package.conf Changes Log Message: OIN-103: fix related_tags_box to not blow up when it does not get an object; also add its action and other actions to docs Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/package.conf,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** package.conf 25 Nov 2004 03:55:41 -0000 1.5 --- package.conf 25 Nov 2004 13:50:33 -0000 1.6 *************** *** 1,4 **** name delicious_tags ! version 0.06 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ --- 1,4 ---- name delicious_tags ! version 0.07 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/Changes,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Changes 25 Nov 2004 03:55:41 -0000 1.5 --- Changes 25 Nov 2004 13:50:33 -0000 1.6 *************** *** 1,4 **** --- 1,9 ---- Revision history for OpenInteract2 package delicious_tags. + 0.07 Thu Nov 25 08:46:02 EST 2004 + + OIN-103: Fix related_tags_box to not blow up when no object + passed in. Also add box and other actions to docs. + 0.06 Wed Nov 24 22:52:46 EST 2004 |
From: Chris W. <la...@us...> - 2004-11-25 13:50:42
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31922/doc Modified Files: delicious_tags.pod Log Message: OIN-103: fix related_tags_box to not blow up when it does not get an object; also add its action and other actions to docs Index: delicious_tags.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/doc/delicious_tags.pod,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** delicious_tags.pod 25 Nov 2004 03:14:04 -0000 1.3 --- delicious_tags.pod 25 Nov 2004 13:50:32 -0000 1.4 *************** *** 99,102 **** --- 99,108 ---- } + + # 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 *************** *** 118,122 **** =head1 ACTIONS ! No actions defined in this package. =head1 OBSERVERS --- 124,148 ---- =head1 ACTIONS ! B<related_tags_box> ! ! Box to display the tags (and the number of other objects tagged by ! them) related to a particular object. You need to pass in an 'object' ! or 'c_object' for it to work: ! ! [% OI.box_add( 'related_tags_box', object = news ) %] ! ! B<tagged_items> ! ! Component to display items given a particular tag. You can invoke this ! anywhere: ! ! <p> ! [% OI.action_execute( 'tagged_items', tag = 'perl' ) %] ! </p> ! ! B<tags> ! ! Currently has single task 'show_tagged_items' which displays a ! full-page version of the 'tagged_items' action. =head1 OBSERVERS *************** *** 124,127 **** --- 150,157 ---- 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 RULESETS |
From: Chris W. <la...@us...> - 2004-11-25 13:50:42
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31922/OpenInteract2/Action Modified Files: DeliciousTags.pm Log Message: OIN-103: fix related_tags_box to not blow up when it does not get an object; also add its action and other actions to docs Index: DeliciousTags.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Action/DeliciousTags.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DeliciousTags.pm 25 Nov 2004 03:55:05 -0000 1.2 --- DeliciousTags.pm 25 Nov 2004 13:50:32 -0000 1.3 *************** *** 15,27 **** my ( $self ) = @_; my $object = $self->param( 'object' ) || $self->param( 'c_object' ); ! my $type = $object->CONFIG->{object_name}; ! my $id = $object->id; ! my $related_with_count = OpenInteract2::DeliciousTaggableObject ! ->c_fetch_my_tags_with_count( $type, $id ); ! my %params = ( ! object => $object, ! tag_and_count => $related_with_count, ! ); ! return $self->generate_content( \%params, --- 15,29 ---- my ( $self ) = @_; my $object = $self->param( 'object' ) || $self->param( 'c_object' ); ! my %params = (); ! if ( $object ) { ! my $type = $object->CONFIG->{object_name}; ! my $id = $object->id; ! my $related_with_count = OpenInteract2::DeliciousTaggableObject ! ->c_fetch_my_tags_with_count( $type, $id ); ! %params = ( ! object => $object, ! tag_and_count => $related_with_count, ! ); ! } return $self->generate_content( \%params, |
From: Chris W. <la...@us...> - 2004-11-25 03:59:07
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/TT2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14199 Modified Files: Plugin.pm Log Message: don't pass the 'do_not_escape' argument onto the URL creator Index: Plugin.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/TT2/Plugin.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Plugin.pm 24 Nov 2004 14:16:01 -0000 1.15 --- Plugin.pm 25 Nov 2004 03:58:57 -0000 1.16 *************** *** 354,376 **** join( '; ', map { "$_ = $p->{$_}" } keys %{ $p } ) ); my ( $url_base ); if ( $p->{BASE} ) { $url_base = $p->{BASE}; delete $p->{ $_ } for ( qw( ACTION TASK BASE IMAGE STATIC ) ); ! return $U->create( $url_base, $p, $p->{do_not_escape} ); } elsif ( $p->{ACTION} ) { my ( $action, $task ) = ( $p->{ACTION}, $p->{TASK} ); delete $p->{ $_ } for ( qw( ACTION TASK BASE IMAGE STATIC ) ); ! return $U->create_from_action( $action, $task, $p, $p->{do_not_escape} ); } elsif ( $p->{IMAGE} ) { my $image_url = $p->{IMAGE}; delete $p->{ $_ } for ( qw( ACTION TASK BASE IMAGE STATIC ) ); ! return $U->create_image( $image_url, $p, $p->{do_not_escape} ); } elsif ( $p->{STATIC} ) { my $static_url = $p->{STATIC}; delete $p->{ $_ } for ( qw( ACTION TASK BASE IMAGE STATIC ) ); ! return $U->create_static( $static_url, $p, $p->{do_not_escape} ); } else { --- 354,378 ---- join( '; ', map { "$_ = $p->{$_}" } keys %{ $p } ) ); my ( $url_base ); + my $no_escape = $p->{do_not_escape}; + delete $p->{do_not_escape}; if ( $p->{BASE} ) { $url_base = $p->{BASE}; delete $p->{ $_ } for ( qw( ACTION TASK BASE IMAGE STATIC ) ); ! return $U->create( $url_base, $p, $no_escape ); } elsif ( $p->{ACTION} ) { my ( $action, $task ) = ( $p->{ACTION}, $p->{TASK} ); delete $p->{ $_ } for ( qw( ACTION TASK BASE IMAGE STATIC ) ); ! return $U->create_from_action( $action, $task, $p, $no_escape ); } elsif ( $p->{IMAGE} ) { my $image_url = $p->{IMAGE}; delete $p->{ $_ } for ( qw( ACTION TASK BASE IMAGE STATIC ) ); ! return $U->create_image( $image_url, $p, $no_escape ); } elsif ( $p->{STATIC} ) { my $static_url = $p->{STATIC}; delete $p->{ $_ } for ( qw( ACTION TASK BASE IMAGE STATIC ) ); ! return $U->create_static( $static_url, $p, $no_escape ); } else { |
From: Chris W. <la...@us...> - 2004-11-25 03:55:55
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13704 Modified Files: package.conf MANIFEST Changes Log Message: metadata Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/package.conf,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** package.conf 25 Nov 2004 03:14:04 -0000 1.4 --- package.conf 25 Nov 2004 03:55:41 -0000 1.5 *************** *** 1,4 **** name delicious_tags ! version 0.05 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ --- 1,4 ---- name delicious_tags ! version 0.06 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/MANIFEST,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MANIFEST 25 Nov 2004 03:14:04 -0000 1.4 --- MANIFEST 25 Nov 2004 03:55:41 -0000 1.5 *************** *** 17,18 **** --- 17,19 ---- template/related_tags.tmpl template/tagged_objects.tmpl + template/tagged_objects_page.tmpl Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/Changes,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Changes 25 Nov 2004 03:14:04 -0000 1.4 --- Changes 25 Nov 2004 03:55:41 -0000 1.5 *************** *** 1,4 **** --- 1,9 ---- Revision history for OpenInteract2 package delicious_tags. + 0.06 Wed Nov 24 22:52:46 EST 2004 + + Things are working. Add a new action plus template to display + all tagged objects on a page, other small but useful changes. + 0.05 Wed Nov 24 22:11:33 EST 2004 |
From: Chris W. <la...@us...> - 2004-11-25 03:55:46
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13677/OpenInteract2 Modified Files: DeliciousTaggableObject.pm Log Message: ensure the URL we store is NOT contextualized Index: DeliciousTaggableObject.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/DeliciousTaggableObject.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DeliciousTaggableObject.pm 25 Nov 2004 03:14:04 -0000 1.4 --- DeliciousTaggableObject.pm 25 Nov 2004 03:55:31 -0000 1.5 *************** *** 4,10 **** --- 4,12 ---- use strict; + use OpenInteract2::URL; sub c_add_tags { my ( $class, $object_type, $object_id, $url, $name, @tags ) = @_; + $url = OpenInteract2::URL->strip_deployment_context( $url ); require OpenInteract2::DeliciousTag; return OpenInteract2::DeliciousTag *************** *** 39,42 **** --- 41,51 ---- my ( $object, @tags ) = @_; my $info = $object->object_description; + + # We want to remove any deployment descriptor from the front -- + # URLs are stored non-contextualized so things won't get hinky if + # you need to relocate + + $info->{url} = OpenInteract2::URL->strip_deployment_context( $info->{url} ); + return __PACKAGE__->c_add_tags( $info->{name}, $info->{object_id}, $info->{url}, $info->{title}, @tags ); |
From: Chris W. <la...@us...> - 2004-11-25 03:55:19
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13626/OpenInteract2/Action Modified Files: DeliciousTags.pm Log Message: add full action for displaying tagged objects Index: DeliciousTags.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Action/DeliciousTags.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DeliciousTags.pm 24 Oct 2004 16:40:08 -0000 1.1 --- DeliciousTags.pm 25 Nov 2004 03:55:05 -0000 1.2 *************** *** 31,42 **** sub tagged_objects { my ( $self ) = @_; my $request = CTX->request; my $tag = $self->param( 'tag' ) || $request->param( 'tag' ); my %params = ( tag => $tag ); if ( $tag ) { - $self->param_add( - error_msg => "Must specify 'tag' to find related objects" ); - } - else { my $tag_class = CTX->lookup_object( 'delicious_tag' ); my $object_refs = $tag_class->fetch_group({ --- 31,48 ---- sub tagged_objects { my ( $self ) = @_; + return $self->generate_content( $self->_generate_tagged_objects_params ); + } + + sub show_tagged_objects { + my ( $self ) = @_; + return $self->generate_content( $self->_generate_tagged_objects_params ); + } + + sub _generate_tagged_objects_params { + my ( $self ) = @_; my $request = CTX->request; my $tag = $self->param( 'tag' ) || $request->param( 'tag' ); my %params = ( tag => $tag ); if ( $tag ) { my $tag_class = CTX->lookup_object( 'delicious_tag' ); my $object_refs = $tag_class->fetch_group({ *************** *** 46,50 **** $params{tag_info} = $object_refs; } ! return $self->generate_content( \%params ); } --- 52,60 ---- $params{tag_info} = $object_refs; } ! else { ! $self->param_add( ! error_msg => "Must specify 'tag' to find related objects" ); ! } ! return \%params; } |
From: Chris W. <la...@us...> - 2004-11-25 03:55:08
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13563/conf Modified Files: action.ini Log Message: add full action for displaying tagged objects Index: action.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/conf/action.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** action.ini 25 Nov 2004 03:14:04 -0000 1.2 --- action.ini 25 Nov 2004 03:54:56 -0000 1.3 *************** *** 15,16 **** --- 15,23 ---- is_secure = no template_source = delicious_tags::tagged_objects + + [tags] + class = OpenInteract2::Action::DeliciousTags + is_secure = no + + [tags template_source] + show_tagged_objects = delicious_tags::tagged_objects_page |
From: Chris W. <la...@us...> - 2004-11-25 03:54:46
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13491/template Modified Files: related_tags.tmpl Log Message: display message if no tags found; actually use the URL we generate (duh) Index: related_tags.tmpl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/template/related_tags.tmpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** related_tags.tmpl 25 Nov 2004 03:12:56 -0000 1.1 --- related_tags.tmpl 25 Nov 2004 03:54:27 -0000 1.2 *************** *** 1,6 **** ! [% FOREACH tag_count = tag_and_count; ! tagged_objects_url = OI.make_url( ACTION = 'tags', ! TASK = 'show_tagged_objects', ! tag = tag_count.0 ); %] ! o <a href="">[% tag_count.0 %]</a> ([% tag_count.1 %]) <br /> [% END %] \ No newline at end of file --- 1,10 ---- ! [% IF tag_and_count.size > 0 %] ! [% FOREACH tag_count = tag_and_count; ! tagged_objects_url = OI.make_url( ACTION = 'tags', ! TASK = 'show_tagged_objects', ! tag = tag_count.0 ); %] ! o <a href="[% tagged_objects_url %]">[% tag_count.0 %]</a> ([% tag_count.1 %]) <br /> ! [% END %] ! [% ELSE %] ! No related tags. [% END %] \ No newline at end of file |