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-29 05:10:48
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags/OpenInteract2/App Added Files: ObjectTags.pm Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: ObjectTags.pm --- package OpenInteract2::App::ObjectTags; # $Id: ObjectTags.pm,v 1.1 2005/03/29 05:10:37 lachoy Exp $ use strict; use base qw( Exporter OpenInteract2::App ); use OpenInteract2::Manage; $OpenInteract2::App::ObjectTags::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); @OpenInteract2::App::ObjectTags::EXPORT = qw( install ); my $NAME = 'object_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; } sub new { return OpenInteract2::App->new( $NAME ); } sub get_brick { require OpenInteract2::Brick; return OpenInteract2::Brick->new( $NAME ); } sub get_brick_name { return $NAME; } OpenInteract2::App->register_factory_type( $NAME => __PACKAGE__ ); 1; __END__ =pod =head1 NAME OpenInteract2::App::ObjectTags - Mark generic objects with simple text tags =head1 SYNOPSIS # Mark an action ('myaction') with the object tag observer; this # means it will attach tags found in the request variable # 'object_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] object_tag = OpenInteract2::Observer::AddObjectTags [map] object_tag = myaction # Mark an object ('myobject') as taggable with object 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( 'object_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 copy of the ideas at L<http://del.icio.us/>, a social bookmarking system and L<http://flickr.com/>, a photo sharing site. 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::TaggableObject> 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. You may also call these methods as class methods but need to pass in additional information. =head2 Getting tags into the system The best way is to use the action observer L<OpenInteract2::Observer::AddObjectTags>. Once it's configured as discussed in L<SYNOPSIS> it will sit back and watch for 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::TaggableObject::add_tags( $my_object, @tags ); # ...or if $my_object is not an SPOPS object OpenInteract2::TaggableObject->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( 'object_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( 'object_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<object_tag> See L<OpenInteract2::ObjectTag> 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::AddObjectTags> 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::ObjectTagWatcher> Translates: [myspops] ... is_taggable = yes into a request to add L<OpenInteract2::TaggableObject> 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-29 05:10:47
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags Added Files: Changes MANIFEST MANIFEST.SKIP package.ini Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: Changes --- Revision history for OpenInteract2 package object_tags. 0.60 Wed Mar 23 22:59:13 EST 2005 Rename from 'delicious*' to 'object*' 0.50 Wed Mar 16 22:51:49 EST 2005 Upgrade to new package format (package.ini, App.pm, etc.) and bump version number to indicate stability. 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 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 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 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 Try and get kinks out... 0.04 Wed Nov 24 21:29:38 EST 2004 Cosmetic 0.03 Mon Oct 25 23:27:09 EDT 2004 - Add OI2::DeliciousTagWatcher and configure in package.conf 0.02 Sun Oct 24 22:18:30 EDT 2004 - Add OI2::Observer::AddDeliciousTags - Add 'add_tags()' methods to OI2::DeliciousTaggableObject and OI2::DeliciousTag 0.01 Fri Oct 22 06:03:21 2004 Everything is new! --- NEW FILE: MANIFEST --- Changes MANIFEST MANIFEST.SKIP package.ini conf/action.ini conf/spops.ini msg/object_tags-en.msg struct/object_tags.sql struct/object_tags_sequence.sql OpenInteract2/ObjectTag.pm OpenInteract2/ObjectTagWatcher.pm OpenInteract2/TaggableObject.pm OpenInteract2/Action/ObjectTags.pm OpenInteract2/App/ObjectTags.pm OpenInteract2/Observer/AddObjectTags.pm OpenInteract2/SQLInstall/ObjectTags.pm template/related_tags.tmpl template/tag_listing.tmpl template/tagged_objects.tmpl template/tagged_objects_page.tmpl --- NEW FILE: MANIFEST.SKIP --- \bCVS\b ~$ ^oi2_manage\.log$ \.old$ \.bak$ \.backup$ ^tmp ^_ --- NEW FILE: package.ini --- [package] name = object_tags version = 0.60 author = Chris Winters <ch...@cw...> url = http://www.openinteract.org/ sql_installer = OpenInteract2::SQLInstall::ObjectTags config_watcher = OpenInteract2::ObjectTagWatcher description = Lightweight tags to relate any objects. |
From: Chris W. <la...@us...> - 2005-03-29 05:10:47
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/struct In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags/struct Added Files: object_tags.sql object_tags_sequence.sql Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: object_tags.sql --- CREATE TABLE object_tags ( tag_id %%INCREMENT%% NOT NULL, tag VARCHAR(35) NOT NULL, object_type VARCHAR(20) NOT NULL, object_id %%INCREMENT_TYPE%% NOT NULL, name VARCHAR(100) NULL, url VARCHAR(150) NULL, created_on %%DATETIME%% NULL, PRIMARY KEY( tag_id ), UNIQUE( tag, object_type, object_id ) ); --- NEW FILE: object_tags_sequence.sql --- CREATE SEQUENCE object_tags_seq; |
From: Chris W. <la...@us...> - 2005-03-29 05:10:47
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/msg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags/msg Added Files: object_tags-en.msg Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: object_tags-en.msg --- 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. |
From: Chris W. <la...@us...> - 2005-03-29 05:10:47
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags/template Added Files: related_tags.tmpl tag_listing.tmpl tagged_objects.tmpl tagged_objects_page.tmpl Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: related_tags.tmpl --- [% IF tag_and_count.size > 0 %] [% INCLUDE object_tags::tag_listing %] [% ELSE %] [% MSG( 'tags.no_related_tags' ) %] [% END %] --- 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 <span class="tagListing"><a href="[% tagged_objects_url %]">[% tag_count.0 %]</a> ([% tag_count.1 %])</span><br /> [% END %] --- NEW FILE: tagged_objects.tmpl --- [% FOREACH info = tag_info; item_url = OI.make_url( BASE = info.url, do_not_escape = 1 ) %] o <span class="taggedObject">[% info.object_type %]: <a href="[% item_url %]">[% info.name %]</a></span><br /> [% END %] --- NEW FILE: tagged_objects_page.tmpl --- [% PROCESS error_message %] <h2>Objects by Tag</h2> <p><b>Tag:</b> [% tag %]</p> <p> [% INCLUDE object_tags::tagged_objects %] </p> |
From: Chris W. <la...@us...> - 2005-03-29 05:10:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/Observer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags/OpenInteract2/Observer Added Files: AddObjectTags.pm Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: AddObjectTags.pm --- package OpenInteract2::Observer::AddObjectTags; # $Id: AddObjectTags.pm,v 1.1 2005/03/29 05:10:37 lachoy Exp $ use strict; use Log::Log4perl qw( get_logger ); use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); $OpenInteract2::Observer::AddObjectTags::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); my ( $log ); sub update { my ( $class, $action, $observation ) = @_; $log ||= get_logger( LOG_APP ); $log->is_debug && $log->debug( "object tag observer caught: $observation" ); unless ( $observation =~ /^post (add|update)$/ ) { $log->is_debug && $log->debug( "Ignoring: not 'post add' or 'post update'" ); return; } require OpenInteract2::TaggableObject; my $action_desc = join( '', '(from action/task: ', $action->name, '/', $action->task, ')' ); my $object = $action->param( 'object' ) || $action->param( 'c_object' ); unless ( $object ) { $log->warn( "Cannot find an object to which I should attach ", "the object tags $action_desc" ); return; } my $tag_listing = $action->param( 'tags' ) || CTX->request->param( 'tags' ); unless ( $tag_listing ) { $log->warn( "No object tags found $action_desc" ); 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::TaggableObject::add_tags( $object, @all_tags ); } 1; __END__ =head1 NAME OpenInteract2::Observer::AddObjectTags - Add tags to an object from any action =head1 SYNOPSIS # Add the observation as available # in $WEBSITE_DIR/conf/observer.ini [observer] object_tag = OpenInteract2::Observer::AddObjectTags # Mark your action 'myaction' to be observed and have the tags from # the request or action parameter 'tags' mapped to your object [map] object_tag = myaction =head1 DESCRIPTION =over 4 =item * Only reacts to 'post add' or 'post update' observations; all others are ignored. (By coincidence these are issued by the common actions...) =item * Finds the object to which it should attach the tags in the action parameter 'object' or 'c_object'. If an object is not found there the observer does nothing. =item * Finds the tags to attach in the action parameter 'tags' or the L<OpenInteract2::Request> parameter 'tags'. If no tags are found the observer does nothing. =item * On finding everything we pass the data to the C<add_tags> method of L<OpenInteract2::TaggableObject>. =back =head1 SEE ALSO L<Class::Observable> L<OpenInteract2::Action> L<OpenInteract2::ObjectTag> L<OpenInteract2::TaggableObject> =head1 COPYRIGHT Copyright (c) 2004-2005 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...> - 2005-03-29 05:10:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags/OpenInteract2/Action Added Files: ObjectTags.pm Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: ObjectTags.pm --- package OpenInteract2::Action::ObjectTags; # $Id: ObjectTags.pm,v 1.1 2005/03/29 05:10:37 lachoy Exp $ use strict; use base qw( OpenInteract2::Action ); use Log::Log4perl qw( get_logger ); use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); use OpenInteract2::TaggableObject; $OpenInteract2::Action::ObjectTags::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); sub all_tags { my ( $self ) = @_; my $tag_class = CTX->lookup_object( 'object_tag' ); my $tags = $tag_class->fetch_all_tags_with_count(); return $self->generate_content({ tag_and_count => $tags }); } sub related_tags { 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::TaggableObject ->fetch_my_tags_with_count( $type, $id ); %params = ( object => $object, tag_and_count => $related_with_count, ); } return $self->generate_content( \%params ); } 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( 'object_tag' ); my $object_refs = $tag_class->fetch_group({ where => 'tag = ?', value => [ $tag ], }); $params{tag_info} = $object_refs; } else { $self->param_add( error_msg => $self->_msg( 'tags.error.related_objects_no_tag' ) ); } return \%params; } 1; |
From: Chris W. <la...@us...> - 2005-03-29 05:10:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/SQLInstall In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags/OpenInteract2/SQLInstall Added Files: ObjectTags.pm Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: ObjectTags.pm --- package OpenInteract2::SQLInstall::ObjectTags; # $Id: ObjectTags.pm,v 1.1 2005/03/29 05:10:37 lachoy Exp $ use strict; use base qw( OpenInteract2::SQLInstall ); my %FILES = ( sequence => 'object_tags_sequence.sql', default => 'object_tags.sql', ); sub get_structure_set { return 'object_tag'; } sub get_structure_file { my ( $self, $set, $type ) = @_; if ( $type =~ /^(Pg|Oracle)$/ ) { return [ $FILES{sequence}, $FILES{default} ]; } return [ $FILES{default} ]; } 1; |
From: Chris W. <la...@us...> - 2005-03-29 05:10:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags/conf Added Files: action.ini spops.ini Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: action.ini --- [related_tags_box] class = OpenInteract2::Action::ObjectTags task = related_tags is_secure = no url_none = yes weight = 2 title_key = tags.related_tags_box.title cache_expire = 10m template_source = object_tags::related_tags [all_tags_box] class = OpenInteract2::Action::ObjectTags task = all_tags is_secure = no url_none = yes weight = 2 title_key = tags.all_tags_box.title cache_expire = 10m template_source = object_tags::tag_listing # meant to be used as component [tagged_objects] class = OpenInteract2::Action::ObjectTags task = tagged_objects is_secure = no url_none = yes template_source = object_tags::tagged_objects [tags] class = OpenInteract2::Action::ObjectTags is_secure = no [tags template_source] show_tagged_objects = object_tags::tagged_objects_page all_tags = object_tags::tag_listing --- NEW FILE: spops.ini --- [object_tag] class = OpenInteract2::ObjectTagPersist alias_class = OpenInteract2::ObjectTag field = field_discover = yes id_field = tag_id increment_field = yes sequence_name = object_tags_seq is_secure = no no_insert = tag_id no_update = tag_id skip_undef = tag_id convert_date_field = created_on sql_defaults = base_table = object_tags name = tag object_name = Tags |
From: Chris W. <la...@us...> - 2005-03-29 05:10:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30046/object_tags/OpenInteract2 Added Files: ObjectTag.pm ObjectTagWatcher.pm TaggableObject.pm Log Message: OIN-37: migrate delicious_tags package to core --- NEW FILE: ObjectTag.pm --- package OpenInteract2::ObjectTag; # $Id: ObjectTag.pm,v 1.1 2005/03/29 05:10:37 lachoy Exp $ use strict; use DateTime; use Log::Log4perl qw( get_logger ); use OpenInteract2::Constants qw( :log ); @OpenInteract2::ObjectTag::ISA = qw( OpenInteract2::ObjectTagPersist ); my ( $log ); # TODO: this should be wrapped in a transaction... 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, where => 'object_type = ? AND object_id = ?', value => [ $object_type, $object_id ], }); # ..then add all the given tags so there's no overlap foreach my $tag ( @tags ) { $class->new({ tag => $tag, object_type => $object_type, object_id => $object_id, url => $url, name => $name, created_on => DateTime->now(), })->save(); } } sub fetch_all_tags { my ( $class ) = @_; my $tags = $class->db_select({ select_modifier => 'DISTINCT', select => [ 'tag' ], from => [ $class->table_name ], order => 'tag', return => 'single-list', }); return $tags; } sub fetch_all_tags_with_count { my ( $class, $hash_option ) = @_; my $counts = $class->db_select({ select => [ 'tag', 'count(*)' ], from => [ $class->table_name ], order => 'tag', group => 'tag', }); return $class->_translate_tag_and_count( $counts, $hash_option ); } sub fetch_tags_for_object { my ( $class, $object_type, $object_id ) = @_; my $tags = $class->db_select({ select => [ 'tag' ], from => [ $class->table_name ], where => 'object_type = ? AND object_id = ?', value => [ $object_type, $object_id ], order => 'tag', return => 'single-list', }); return $tags; } 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 # first so there's only one instance of each in the returned arrayref 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, value => \@values, order => 'object_type', }); $log->is_debug && $log->debug( "Found ", scalar @{ $tag_objects }, " items; now ", "finding unique objects..." ); my @uniq_tag_objects = (); my %seen = (); foreach my $tag_object ( @{ $tag_objects } ) { my ( $type, $id ) = ( $tag_object->{object_type}, $tag_object->{object_id} ); next if ( $seen{ $type }->{ $id } ); $seen{ $type }->{ $id }++; 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 ) = @_; my $count = $class->db_select({ select => [ 'count(*)' ], from => [ $class->table_name ], where => 'tag = ?', value => [ $tag ], return => 'single-list', }); return $count->[0]; } sub fetch_related_tags { 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 FROM $table d1, $table d2 WHERE ( $base_where ) AND d2.object_type = d1.object_type AND d2.object_id = d1.object_id AND d2.tag != d1.tag }; my $tags = $class->db_select({ sql => $sql, value => $tag_values, return => 'single-list', }); return $tags; } 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::ObjectTag - SPOPS class for lightweight object tags =head1 SYNOPSIS my $tag_class = CTX->lookup_object( 'object_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::ObjectTag objects tagged with # 'linux' my $items = $tag_class->fetch_tag_objects( 'linux' ); # Find all the OpenInteract2::ObjectTag objects tagged with # 'linux' or 'win32' my $items = $tag_class->fetch_tag_objects( [ 'linux', 'win32' ] ); # Find all the OpenInteract2::ObjectTag 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::ObjectTag 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::ObjectTag 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::ObjectTag> 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::TaggableObject>: To call some of these methods in relation to another object. L<OpenInteract2::Observer::AddObjectTags>: Which adds tags based on object adds/updates. =head1 COPYRIGHT Copyright (c) 2004-2005 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> --- NEW FILE: ObjectTagWatcher.pm --- package OpenInteract2::ObjectTagWatcher; # $Id: ObjectTagWatcher.pm,v 1.1 2005/03/29 05:10:37 lachoy Exp $ use strict; $OpenInteract2::ObjectTagWatcher::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); sub update { my ( $class, $type, $config ) = @_; return unless ( $type eq 'spops' and ref $config eq 'HASH' ); if ( $config->{is_taggable} eq 'yes' ) { $config->{isa} ||= []; push @{ $config->{isa} }, 'OpenInteract2::TaggableObject'; } } 1; __END__ =head1 NAME OpenInteract2::ObjectTagWatcher - Configuration watcher to look for 'is_taggable' =head1 SYNOPSIS [myspops] class = OpenInteract2::Foo ... is_taggable = yes # At startup OpenInteract2::Foo will have # OpenInteract2::TaggableObject in its 'isa' =head1 DESCRIPTION Configuration initializer to add a shortcut to SPOPS configuration -- a 'is_taggable = yes' will result in the SPOPS class getting L<OpenInteract2::TaggableObject> in its 'isa'. =head1 SEE ALSO L<OpenInteract2::Config::Initializer> =head1 COPYRIGHT Copyright (c) 2004-2005 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> --- NEW FILE: TaggableObject.pm --- package OpenInteract2::TaggableObject; # $Id: TaggableObject.pm,v 1.1 2005/03/29 05:10:37 lachoy Exp $ use strict; use OpenInteract2::URL; use Scalar::Util qw( blessed ); sub add_tags { my ( $item, @data ) = @_; require OpenInteract2::ObjectTag; my ( $object_type, $object_id, $url, $name, @tags ); # call from object: tags are in @data if ( blessed $item ) { my $info = $item->object_description; ( $object_type, $object_id, $url, $name, @tags ) = ( $info->{name}, $info->{object_id}, $info->{url}, $info->{title}, @data ); } else { ( $object_type, $object_id, $url, $name, @tags ) = @data; } # 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 $url = OpenInteract2::URL->strip_deployment_context( $url ); return OpenInteract2::ObjectTag->add_tags( $object_type, $object_id, $url, $name, @tags ); } sub fetch_my_tags { my ( $item, @data ) = @_; require OpenInteract2::ObjectTag; my ( $object_type, $object_id ); if ( blessed $item ) { $object_type = $item->CONFIG->{object_name}; $object_id = $item->id; } else { ( $object_type, $object_id ) = @data; } return OpenInteract2::ObjectTag ->fetch_tags_for_object( $object_type, $object_id ); } sub fetch_my_tags_with_count { my ( $item, @data ) = @_; require OpenInteract2::ObjectTag; my ( $object_type, $object_id ); if ( blessed $item ) { $object_type = $item->CONFIG->{object_name}; $object_id = $item->id; } else { ( $object_type, $object_id ) = @data; } return OpenInteract2::ObjectTag ->fetch_tags_with_count_for_object( $object_type, $object_id ); } sub fetch_my_related_object_info { my ( $item, @data ) = @_; require OpenInteract2::ObjectTag; my ( $object_type, $object_id, @tags ); if ( blessed $item ) { $object_type = $item->CONFIG->{object_name}; $object_id = $item->id; @tags = @data; } else { ( $object_type, $object_id, @tags ) = @data; } my $related_tags = OpenInteract2::ObjectTag->fetch_related_tags( $object_type, $object_id, @tags ); return OpenInteract2::ObjectTag ->fetch_tag_objects( $related_tags, $object_type, $object_id ); } 1; |
From: Chris W. <la...@us...> - 2005-03-29 05:09:15
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags/conf Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags/conf added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:09:15
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags/OpenInteract2/App Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/App added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:09:14
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags/OpenInteract2 Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2 added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:09:14
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/SQLInstall In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags/OpenInteract2/SQLInstall Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/SQLInstall added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:09:13
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/struct In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags/struct Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags/struct added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:09:13
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags/OpenInteract2/Action Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/Action added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:09:13
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags/template Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags/template added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:09:13
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/Observer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags/OpenInteract2/Observer Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags/OpenInteract2/Observer added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:09:12
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags/msg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags/msg Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags/msg added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:09:12
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/object_tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/object_tags Log Message: Directory /cvsroot/openinteract/OpenInteract2/pkg/object_tags added to the repository |
From: Chris W. <la...@us...> - 2005-03-29 05:07:44
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_box/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28818/base_box/OpenInteract2/Action Modified Files: Box.pm Log Message: OIN-58: more fixes... Index: Box.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/OpenInteract2/Action/Box.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Box.pm 29 Mar 2005 02:36:22 -0000 1.13 --- Box.pm 29 Mar 2005 05:07:35 -0000 1.14 *************** *** 23,27 **** my $DEFAULT_WEIGHT = 5; my $MAX_WEIGHT = 100; ! my ( $BLANK_SHELL, $DEFAULT_SHELL ); my ( $BASE_TEMPLATE_ACTION ); --- 23,30 ---- my $DEFAULT_WEIGHT = 5; my $MAX_WEIGHT = 100; ! my ( $BLANK_SHELL_NAME, $DEFAULT_SHELL ); ! my ( $DEFAULT_TITLE, $DEFAULT_TITLE_KEY ); ! my ( $DEFAULT_TITLE_IMG, $DEFAULT_TITLE_IMG_KEY ); ! my ( $DEFAULT_TITLE_ALT, $DEFAULT_TITLE_ALT_KEY ); my ( $BASE_TEMPLATE_ACTION ); *************** *** 30,35 **** my $action_info = CTX->lookup_action_info( $action_name ); my $log_init = get_logger( LOG_INIT ); ! $BLANK_SHELL = $action_info->{blank_box_template}; ! $DEFAULT_SHELL = $action_info->{default_box_template}; my @classes = (); --- 33,40 ---- my $action_info = CTX->lookup_action_info( $action_name ); my $log_init = get_logger( LOG_INIT ); ! $BLANK_SHELL_NAME = $action_info->{blank_box_template}; ! $DEFAULT_SHELL = $action_info->{default_box_template}; ! $DEFAULT_TITLE = $action_info->{default_title}; ! $DEFAULT_TITLE_KEY = $action_info->{default_title_key}; my @classes = (); *************** *** 47,55 **** $log->info( "Brought in box implementation class '$_' ok" ); } - $BASE_TEMPLATE_ACTION = eval { CTX->lookup_action( 'template_only' ) }; - if ( $@ ) { - oi_error "Cannot create 'template_only' action -- this should be ", - "in the 'base' package but I could not find it." - } } --- 52,55 ---- *************** *** 58,72 **** $log ||= get_logger( LOG_APP ); my $controller = CTX->controller; - my @base_actions = grep { ! $controller->is_box_removed( $_->{name} ) } $self->_create_box_actions, $self->_create_additional_boxes( $self->param( 'system_box_class' ) ), $self->_create_additional_boxes( $self->param( 'custom_box_class' ) ); - $log->is_info && $log->info( "Found ", scalar( @base_actions ), " boxes to process ", "after getting all boxes (added, system and custom) ", "and ensuring that none of them are to be removed" ); - my @sorted_actions = sort { $a->param( 'weight' ) <=> $b->param( 'weight' ) --- 58,69 ---- *************** *** 98,101 **** --- 95,106 ---- my ( $self ) = @_; $log ||= get_logger( LOG_APP ); + unless ( $BASE_TEMPLATE_ACTION ) { + $BASE_TEMPLATE_ACTION = eval { CTX->lookup_action( 'template_only' ) }; + if ( $@ ) { + oi_error "Cannot create 'template_only' action -- this should be ", + "in the 'base' package but I could not find it." + } + } + my @actions = (); foreach my $box_info ( @{ CTX->controller->get_boxes } ) { *************** *** 134,144 **** my ( $self, $box, $box_info ) = @_; ! # first, assign defaults from box action foreach my $box_key ( @BOX_PARAMS ) { ! my $value = $box_info->{ $box_key } ! || $self->param( 'default_' . $box_key ); $box->param( $box_key, $value ); ! $log->is_debug && ! $log->debug( "Assigned $box_key => $value" ); delete $box_info->{ $box_key }; } --- 139,148 ---- my ( $self, $box, $box_info ) = @_; ! # first, assign data from box action -- don't assign defaults here foreach my $box_key ( @BOX_PARAMS ) { ! my $value = $box_info->{ $box_key }; ! next unless ( $value ); $box->param( $box_key, $value ); ! $log->is_debug && $log->debug( "Assigned $box_key => $value" ); delete $box_info->{ $box_key }; } *************** *** 186,190 **** # user has requested to keep box naked... ! if ( $shell_template eq $BLANK_SHELL ) { push @content, $base_content; $log->is_debug && --- 190,194 ---- # user has requested to keep box naked... ! if ( $shell_template eq $BLANK_SHELL_NAME ) { push @content, $base_content; $log->is_debug && *************** *** 195,207 **** my %shell_params = (); $shell_params{content} = $base_content; ! $shell_params{label} = $action->message_from_key_or_param( ! 'title', 'title_key' ); ! $shell_params{label_image_src} = $action->message_from_key_or_param( ! 'title_image_src', 'title_image_src_key' ); ! $shell_params{label_image_alt} = $action->message_from_key_or_param( ! 'title_image_alt', 'title_image_alt_key' ); push @content, $action->generate_content( \%shell_params, { name => $shell_template } --- 199,220 ---- my %shell_params = (); $shell_params{content} = $base_content; ! $shell_params{label} = _assign_from_key_or_param_or_defaults( ! $action, 'title', 'title_key', ! $DEFAULT_TITLE, $DEFAULT_TITLE_KEY ); ! $shell_params{label_image_src} = _assign_from_key_or_param_or_defaults( ! $action, 'title_image_src', 'title_image_src_key', ! $DEFAULT_TITLE_IMG, $DEFAULT_TITLE_IMG_KEY ); ! $shell_params{label_image_alt} = _assign_from_key_or_param_or_defaults( ! $action, 'title_image_src', 'title_image_src_key', ! $DEFAULT_TITLE_ALT, $DEFAULT_TITLE_ALT_KEY ); + my $name = $action->name; + $log->is_debug && + $log->debug( "Filling box shell for '$name' with ", + "[Label: $shell_params{label}] ", + "[img src: $shell_params{label_image_src}] ", + "[img alt: $shell_params{label_image_alt}] " ); push @content, $action->generate_content( \%shell_params, { name => $shell_template } *************** *** 212,215 **** --- 225,245 ---- } + sub _assign_from_key_or_param_or_defaults { + my ( $action, $name, $key, $default_name, $default_key ) = @_; + my $rv = $action->message_from_key_or_param( $name, $key ); + unless ( $rv ) { + if ( $default_name ) { + $rv = $default_name; + } + if ( ! $rv and $default_key ) { + $rv = $action->_msg( $default_key ); + } + } + $log->is_debug && + $log->debug( "Param default: $rv; given ($name, $key, ", + "$default_name, $default_key) "); + return $rv; + } + 1; |
From: Chris W. <la...@us...> - 2005-03-29 02:36:33
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_box/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13339/OpenInteract2/Action Modified Files: SystemBoxes.pm Box.pm Log Message: OIN-58: add examples and more info about creating a box to OI2::App::BaseBox; cleanup the boxes action; update message keys to lose the '.label' Index: SystemBoxes.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/OpenInteract2/Action/SystemBoxes.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SystemBoxes.pm 18 Mar 2005 04:09:43 -0000 1.9 --- SystemBoxes.pm 29 Mar 2005 02:36:22 -0000 1.10 *************** *** 1,3 **** - # TODO: This is not an Action; should it be? Should it be here? package OpenInteract2::Action::SystemBoxes; --- 1,2 ---- *************** *** 26,30 **** if ( $request->auth_is_logged_in ) { $log->is_debug && ! $log->debug( "Adding box [user_info]" ); eval { push @boxes, CTX->lookup_action( 'user_info_box' ) }; if ( $@ ) { --- 25,29 ---- if ( $request->auth_is_logged_in ) { $log->is_debug && ! $log->debug( "Adding box 'user_info'" ); eval { push @boxes, CTX->lookup_action( 'user_info_box' ) }; if ( $@ ) { *************** *** 44,48 **** else { $log->is_debug && ! $log->debug( "Adding box [login]" ); eval { push @boxes, CTX->lookup_action( 'login_box' ) }; if ( $@ ) { --- 43,47 ---- else { $log->is_debug && ! $log->debug( "Adding box 'login'" ); eval { push @boxes, CTX->lookup_action( 'login_box' ) }; if ( $@ ) { *************** *** 68,72 **** ... system_box_handler = OpenInteract2::Handler::SystemBoxes - system_box_method = =head1 DESCRIPTION --- 67,70 ---- *************** *** 92,108 **** Since each box is a component and components are defined through the Action Table, you can define information for each of these boxes in ! the file C<conf/action.ini> for this package or in your website's ! global override. (The information for each should already be defined, ! so if you want to modify any of the values there feel free.) ! ! =head1 BUGS ! ! None known -- hey, it's too simple to have bugs! ! ! =head1 TO DO ! ! B<More?> ! ! Any other system-wide boxes needed? =head1 SEE ALSO --- 90,96 ---- Since each box is a component and components are defined through the Action Table, you can define information for each of these boxes in ! the file C<conf/action.ini> for this package. (The information for ! each should already be defined, so if you want to modify any of the ! values there feel free.) =head1 SEE ALSO *************** *** 110,113 **** --- 98,103 ---- L<OpenInteract2::Action::Box> + L<OpenInteract2::App::BaseBox> + =head1 COPYRIGHT Index: Box.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/OpenInteract2/Action/Box.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Box.pm 18 Mar 2005 04:09:42 -0000 1.12 --- Box.pm 29 Mar 2005 02:36:22 -0000 1.13 *************** *** 15,41 **** my ( $log ); ! my @BOX_KEYS = qw( title weight base_template image image_alt ); ! ! my ( $BOX_CONFIG, ! $SYSTEM_REQUIRED, $SYSTEM_BOX_CLASS, $SYSTEM_BOX_METHOD, ! $CUSTOM_REQUIRED, $CUSTOM_BOX_CLASS, $CUSTOM_BOX_METHOD ); my $DEFAULT_WEIGHT = 5; my $MAX_WEIGHT = 100; sub process_boxes { my ( $self ) = @_; $log ||= get_logger( LOG_APP ); - - $BOX_CONFIG ||= CTX->lookup_box_config; - - my @base_actions = $self->_create_box_actions; - push @base_actions, $self->_create_system_boxes; - push @base_actions, $self->_create_custom_boxes; - my $controller = CTX->controller; ! @base_actions = grep { ! ! $controller->is_box_removed( $_->{name} ) ! } @base_actions; $log->is_info && --- 15,66 ---- my ( $log ); ! my @BOX_PARAMS = qw( ! box_name box_template ! title title_key title_image_src title_image_src_key ! title_image_alt title_image_alt_key ! ); my $DEFAULT_WEIGHT = 5; my $MAX_WEIGHT = 100; + my ( $BLANK_SHELL, $DEFAULT_SHELL ); + my ( $BASE_TEMPLATE_ACTION ); + + sub init_at_startup { + my ( $class, $action_name ) = @_; + my $action_info = CTX->lookup_action_info( $action_name ); + my $log_init = get_logger( LOG_INIT ); + $BLANK_SHELL = $action_info->{blank_box_template}; + $DEFAULT_SHELL = $action_info->{default_box_template}; + + my @classes = (); + if ( my $system_class = $action_info->{ 'system_box_class' } ) { + push @classes, $system_class; + } + if ( my $custom_class = $action_info->{ 'custom_box_class' } ) { + push @classes, $custom_class; + } + for ( @classes ) { + eval "require $_"; + if ( $@ ) { + oi_error "Failed to bring in box implementation class $_: $@"; + } + $log->info( "Brought in box implementation class '$_' ok" ); + } + $BASE_TEMPLATE_ACTION = eval { CTX->lookup_action( 'template_only' ) }; + if ( $@ ) { + oi_error "Cannot create 'template_only' action -- this should be ", + "in the 'base' package but I could not find it." + } + } sub process_boxes { my ( $self ) = @_; $log ||= get_logger( LOG_APP ); my $controller = CTX->controller; ! ! my @base_actions = grep { ! $controller->is_box_removed( $_->{name} ) } ! $self->_create_box_actions, ! $self->_create_additional_boxes( $self->param( 'system_box_class' ) ), ! $self->_create_additional_boxes( $self->param( 'custom_box_class' ) ); $log->is_info && *************** *** 44,132 **** "and ensuring that none of them are to be removed" ); ! my @sorted_actions = ! sort { $a->param( 'weight' ) <=> $b->param( 'weight' ) || ! $a->name cmp $b->name } ! @base_actions; ! my $shell_template = $self->_get_shell_template; ! my @box_content = $self->_generate_box_content( \@sorted_actions, ! $shell_template ); ! ! my $sep_string = CTX->request->theme_values->{box_separator} ! || $BOX_CONFIG->{default_separator} ! || ''; return join( $sep_string, @box_content ); } ! # First, do the system boxes -- this puts box information into the box ! # holding area. (We need to be sure we always have access to the ! # system box class...) ! ! sub _create_system_boxes { ! my ( $self ) = @_; $log ||= get_logger( LOG_APP ); ! ! unless ( $SYSTEM_REQUIRED ) { ! $SYSTEM_BOX_CLASS = $BOX_CONFIG->{system_box_handler}; ! eval "require $SYSTEM_BOX_CLASS"; ! if ( $@ ) { ! $log->error( "FAILED: cannot include system box class ", ! "'$SYSTEM_BOX_CLASS': $@" ); ! $SYSTEM_BOX_CLASS = undef; ! return (); ! } ! else { ! $SYSTEM_BOX_METHOD = $BOX_CONFIG->{system_box_method} ! || $self->param( 'box_default_method' ); ! $SYSTEM_REQUIRED++; ! } ! } ! ! return () unless ( $SYSTEM_BOX_CLASS and $SYSTEM_BOX_METHOD ); ! my @boxes = eval { $SYSTEM_BOX_CLASS->$SYSTEM_BOX_METHOD() }; if ( $@ ) { ! $log->error( "FAILED: cannot execute system box method ", ! "$SYSTEM_BOX_CLASS->$SYSTEM_BOX_METHOD: $@" ); ! } ! return @boxes; ! } ! ! # If a website has boxes that it's adding on every page it can do so ! # in code rather than in a template. Note that this handler can call ! # other handlers as it deems necessary, so that the framework doesn't ! # care about the application-specific usage. ! ! sub _create_custom_boxes { ! my ( $self ) = @_; ! $log ||= get_logger( LOG_APP ); ! ! unless ( $CUSTOM_REQUIRED ) { ! $CUSTOM_BOX_CLASS = $BOX_CONFIG->{custom_box_handler}; ! if ( $CUSTOM_BOX_CLASS ) { ! eval "require $CUSTOM_BOX_CLASS"; ! if ( $@ ) { ! $log->error( "FAILED: cannot require custom box class ", ! "'$CUSTOM_BOX_CLASS': $@" ); ! return (); ! } ! else { ! $CUSTOM_BOX_METHOD = $BOX_CONFIG->{custom_box_method} ! || $self->param( 'box_default_method' ); ! $CUSTOM_REQUIRED++; ! } ! } } ! ! return () unless ( $CUSTOM_BOX_CLASS and $CUSTOM_BOX_METHOD ); ! $log->is_info && ! $log->info( "Calling custom box handler:", ! "$CUSTOM_BOX_CLASS\->$CUSTOM_BOX_METHOD" ); ! my @boxes = eval { $CUSTOM_BOX_CLASS->$CUSTOM_BOX_METHOD() }; ! if ( $@ ) { ! $log->error( "FAILED: cannot call custom box handler ", ! "$CUSTOM_BOX_CLASS\->$CUSTOM_BOX_METHOD: $@" ); } return @boxes; } # Generate the action object for each box --- 69,96 ---- "and ensuring that none of them are to be removed" ); ! my @sorted_actions = sort { ! $a->param( 'weight' ) <=> $b->param( 'weight' ) ! || $a->name cmp $b->name ! } @base_actions; ! my @box_content = $self->_generate_box_content( \@sorted_actions ); ! my $sep_string = $self->param( 'box_separator' ) || ''; return join( $sep_string, @box_content ); } ! sub _create_additional_boxes { ! my ( $self, $box_class ) = @_; ! return () unless ( $box_class ); $log ||= get_logger( LOG_APP ); ! my @boxes = eval { $box_class->handler() }; if ( $@ ) { ! $log->error( "Error getting additional boxes from $box_class: $@" ); } ! else { ! $log->info( "Got ", scalar( @boxes ), " from $box_class" ); } return @boxes; } + # Generate the action object for each box *************** *** 134,195 **** my ( $self ) = @_; $log ||= get_logger( LOG_APP ); - my @actions = (); - - BOX: foreach my $box_info ( @{ CTX->controller->get_boxes } ) { my $use_info = ( ref $box_info ) ? $box_info : { name => $box_info }; unless ( $use_info->{name} ) { ! $log->error( "Skipping box added without a name:\n", ! Dumper( $use_info ) ); next BOX; } - - # Now lookup box action - my $box_action = eval { CTX->lookup_action( $use_info->{name} ) }; ! if ( $@ and $use_info->{is_template} eq 'yes' ) { ! $box_action = eval { CTX->lookup_action( 'template_only' ) }; ! if ( $@ ) { ! oi_error "Cannot create 'template_only' action -- this ", ! "should be in the 'base' package but I could not ", ! "find it." ! } ! $box_action->param( template => $use_info->{name} ); ! } ! elsif ( $@ ) { ! $log->warn( "Skipping box '$use_info->{name}', not found in ", ! "the action table and 'is_template' not set to 'yes'" ); ! next BOX; ! } ! ! # Override the default keys with information set in the box ! # addition ! ! foreach my $box_key ( @BOX_KEYS ) { ! next unless ( $use_info->{ $box_key } ); ! $box_action->param( $box_key, $use_info->{ $box_key } ); ! $log->is_debug && ! $log->debug( "Adding box_key parameter to box: '$box_key' '$use_info->{ $box_key }'" ); ! delete $use_info->{ $box_key }; ! } ! foreach my $param_name ( keys %{ $use_info->{params} } ) { ! $log->is_debug && ! $log->debug( "Adding parameter to box: '$param_name' ", ! "'$use_info->{params}{ $param_name }'" ); ! $box_action->param( $param_name, $use_info->{params}{ $param_name } ); } ! # Assign default weight if not already there and if the weight ! # is too large skip the box entirely - unless ( $box_action->param( 'weight' ) ) { - $box_action->param( 'weight', $DEFAULT_WEIGHT ); - } if ( $box_action->param( 'weight' ) > $MAX_WEIGHT ) { $log->warn( "Skipping box '$use_info->{name}' since ", ! "its weight is more than the max of ", $MAX_WEIGHT ); next BOX; } --- 98,123 ---- my ( $self ) = @_; $log ||= get_logger( LOG_APP ); my @actions = (); foreach my $box_info ( @{ CTX->controller->get_boxes } ) { my $use_info = ( ref $box_info ) ? $box_info : { name => $box_info }; unless ( $use_info->{name} ) { ! $log->error( "Skipping box added without a name:" ); next BOX; } my $box_action = eval { CTX->lookup_action( $use_info->{name} ) }; ! my $error = $@; ! # no action? assume it's a template... ! if ( $error and ! $box_action ) { ! $box_action = $BASE_TEMPLATE_ACTION->clone(); ! $box_action->param( template => $use_info->{name} ); } ! $self->_assign_box_params( $box_action, $use_info ); if ( $box_action->param( 'weight' ) > $MAX_WEIGHT ) { $log->warn( "Skipping box '$use_info->{name}' since ", ! "its weight is more than the max of $MAX_WEIGHT" ); next BOX; } *************** *** 203,230 **** } ! # Grab the template that we'll plug the box content into ! sub _get_shell_template { ! my ( $self ) = @_; ! $log ||= get_logger( LOG_APP ); ! my $box_template_name = CTX->request->theme_values->{box_template} ! || $BOX_CONFIG->{default_template} ! || $self->param( 'box_default_template' ); ! unless ( $box_template_name =~ /::/ ) { ! $log->warn( "Box shell '$box_template_name' is not a ", ! "valid package::name spec; using naked boxes" ); ! $box_template_name = undef; } - $log->is_debug && - $log->debug( "Using box shell template '$box_template_name'" ); - return $box_template_name; - } # Generate content for each box sub _generate_box_content { ! my ( $self, $actions, $shell_template ) = @_; $log ||= get_logger( LOG_APP ); --- 131,171 ---- } ! sub _assign_box_params { ! my ( $self, $box, $box_info ) = @_; ! # first, assign defaults from box action ! foreach my $box_key ( @BOX_PARAMS ) { ! my $value = $box_info->{ $box_key } ! || $self->param( 'default_' . $box_key ); ! $box->param( $box_key, $value ); ! $log->is_debug && ! $log->debug( "Assigned $box_key => $value" ); ! delete $box_info->{ $box_key }; ! } ! # everything else in $box_info (not params) is an action param... ! while ( my ( $key, $value ) = each %{ $box_info } ) { ! next if ( $key eq 'params' ); ! $box->param( $key, $value ); ! } ! ! # ...assign additional stuff in 'params' ! my $additional_params = $box_info->{params} || {}; ! while ( my ( $key, $value ) = each %{ $additional_params } ) { ! $box->param( $key, $value ); } + # assign default weight and check max + unless ( $box->param( 'weight' ) ) { + my $default_weight = $self->param( 'default_weight' ) + || $DEFAULT_WEIGHT; + $box->param( 'weight', $default_weight ); + } + } # Generate content for each box sub _generate_box_content { ! my ( $self, $actions ) = @_; $log ||= get_logger( LOG_APP ); *************** *** 233,264 **** $log->debug( "Sorted boxes currently in the list:", join( ' | ', map { $_->name } @{ $actions } ) ); ACTION: foreach my $action ( @{ $actions } ) { ! my $shell_params = {}; ! ! # Treat the box as a component and get the html back ! ! my $base_content = $action->execute(); ! # If the user has requested to keep this box 'naked', don't ! # wrap it in the shell ! if ( $action->param( 'base_template' ) eq ! $self->param( 'box_blank_shell_template' ) ) { push @content, $base_content; $log->is_debug && $log->debug( "No wrapper template used by request, ", "box is naked! (cover your eyes)" ); - next ACTION; } ! $shell_params->{content} = $base_content; ! $shell_params->{label} = $action->message_from_key_or_param( ! 'title', 'title_key' ); ! $shell_params->{label_image_src} = $action->message_from_key_or_param( ! 'title_image_src', 'title_image_src_key' ); ! $shell_params->{label_image_alt} = $action->message_from_key_or_param( ! 'title_image_alt', 'title_image_alt_key' ); ! push @content, $action->generate_content( $shell_params, ! { name => $shell_template } ); } return @content; --- 174,211 ---- $log->debug( "Sorted boxes currently in the list:", join( ' | ', map { $_->name } @{ $actions } ) ); + ACTION: foreach my $action ( @{ $actions } ) { ! my $base_content = eval { $action->execute() }; ! if ( $@ ) { ! $log->warn( "Caught exception executing box action: $@" ); ! $base_content = "$@"; ! } ! my $shell_template = $self->param( 'box_template' ) || $DEFAULT_SHELL; ! # user has requested to keep box naked... ! if ( $shell_template eq $BLANK_SHELL ) { push @content, $base_content; $log->is_debug && $log->debug( "No wrapper template used by request, ", "box is naked! (cover your eyes)" ); } ! else { ! my %shell_params = (); ! $shell_params{content} = $base_content; ! $shell_params{label} = $action->message_from_key_or_param( ! 'title', 'title_key' ! ); ! $shell_params{label_image_src} = $action->message_from_key_or_param( ! 'title_image_src', 'title_image_src_key' ! ); ! $shell_params{label_image_alt} = $action->message_from_key_or_param( ! 'title_image_alt', 'title_image_alt_key' ! ); ! push @content, $action->generate_content( ! \%shell_params, { name => $shell_template } ! ); ! } } return @content; *************** *** 273,600 **** OpenInteract2::Action::Box -- Handle input and output for independent "boxes" - =head1 SYNOPSIS - - # Deposit all boxes in the current location on the page: - [% OI.action_execute( 'boxes' ) %] - - # Define global box information in server configuration - # ($WEBSITE/conf/server.ini) - - [box] - handler = MyWebsite::Handler::Box - default_template = base_box::main_box_shell - default_separator = <br> - default_method = run_box - system_box_handler = MyWebsite::Handler::SystemBoxes - system_box_method = - custom_box_handler = - custom_box_method = - - # Define an OI action (in mypkg/conf/action.ini) to be used for a box - # with a class and method: - - [current_weather_box] - class = OpenInteract2::Action::Weather - method = box - weight = 5 - title = Current Weather - - # Add a box ('name' maps to the above OI action): - - my $zip = CTX->request->auth_user->{zipcode}; - my $box = { name => 'current_weather_box', - weight => 2, - title => "Weather in Zip Code $zip", - params => { zip_code => $zip }; - CTX->controller->add_box( $box ); - - # Add the same box from a template: - - [% user_zip = OI.login.zip_code; - OI.box_add( 'current_weather_box', - weight = 2, - title = "Weather in Zip Code $user_zip", - zip_code = $user_zip ) -%] - - # Define an OI action (in conf/action.ini) to be used for a - # template-only box, using a localization key instead of a direct - # title : - - [frequent_links_box] - name = frequent_links_box - template = mypkg::box_frequent_links - weight = 8 - title_key = frequent_links.title - security = no - - # Add a template-only box, overriding weight and title: - - my $box = { name => 'frequent_links_box', - weight => 2, - title => "Most visited sites" }; - CTX->controller->add_box( $box ); - - # Add the same box from a template, overriding title: - - [% OI.box_add( 'frequent_links_box', - title = 'Most visited sites' ) %] - - # Remove a box added in another part of the system - - CTX->controller->remove_box( 'motd' ); - - # Remove the same box from a template - - [% OI.box_remove( 'motd' ) %] - =head1 DESCRIPTION ! Boxes are standalone parcels of content that conform to a particular ! format. Think of each box as an OpenInteract action: that action may ! be a piece of code (method in a class) or it may simply be a template. ! ! In either case, the action generates content and the box handler sorts ! the boxes and places the content for each in a 'shell' so all the ! boxes look the same. The standard box looks something like this: ! ! ------------------------- <-- 'shell' ! | BOX TITLE | ! ------------------------- ! | Box content as | ! | generated by an | ! | action or a | ! | template goes here | ! ------------------------- ! ! But you can create your own shell by defining the key 'box_template' ! in your theme to be a particular template (in the ! 'package::template_name' format) or by setting the global ! configuration key 'box.default_template'. ! ! =head1 CONFIGURATION ! ! This module allows you to define default information in two separate ! locations for a number of parameters. ! ! =head2 Server Configuration ! ! In the server configuration found in every OpenInteract website, you ! can define certain information for your boxes under the 'box' key: ! ! =over 4 ! ! =item * ! ! B<handler> ($) (mandatory) ! ! Define the class that will be used to process the boxes. Unless you ! write your own class, this will B<always> be ! C<OpenInteract2::Action:Box> and should not be changed. ! ! =item * ! ! B<separator> ($) (optional) ! ! This is the string used to separate boxes. For instance, if you want ! to put a short horizontal rule between each line, you could set this ! to: ! ! separator = <hr width="50%" noshade/> ! ! Or if you had a custom image you wanted to separate your boxes with: ! ! separator = <div align="center"><img src="/images/box_sep.gif" height="2" width="25"/></div> ! ! This module defines the default separator as '<br>'. It will be used ! only if there is no separator defined in the theme or in the server ! configuration. ! ! =item * ! ! B<default_method> ($) (optional) ! ! Define the method that will be used by boxes that do not specify ! one. This module defines the default method as 'handler' and unless ! you know what you are doing you should not change it. ! ! =item * ! ! B<default_template> ($) (optional) ! ! This is the template into which every box content gets put. Normally ! this is defined in the theme, but if for some reason someone blanked ! the template out this will fill in. ! ! The default template is C<base_box::main_box_shell>, which as the name ! would indicate is installed with this package. ! ! =item * ! ! B<system_box_handler> ($) (optional) ! ! Defines what we should run on every request to display system ! boxes. See ! L<OpenInteract2::Action::SystemBoxes|OpenInteract2::Action::SystemBoxes> ! for what this includes. ! ! It is okay if you blank this out, you just will not get the 'login', ! 'templates_used' and other boxes on every page. ! ! =item * ! ! B<system_box_method> ($) (optional) ! ! Method to call on the C<system_box_handler> defined above. ! ! =item * ! ! B<custom_box_handler> ($) (optional) ! ! If you want to call a custom handler to run every time B<in addition ! to> the system handler named above, list the class here. ! ! =item * ! ! B<custom_box_method> ($) (optional) ! ! Method to call on the C<custom_box_handler> named above. ! ! =back ! ! =head2 Theme Properties ! ! Two properties of the boxes can be defined on a per-theme basis. ! ! =over 4 ! ! =item * ! ! B<box_template> ($) (optional) ! ! This is the template into which the box content gets put. OpenInteract ! ships with one theme which has this property set to 'main_box_shell', ! which is used if you do not specify anything. However, you can define ! additional themes and change the look of a box entirely by modifying ! this template. ! ! =item * ! ! B<box_separator> ($) (optional, but recommended) ! ! See the discussion of B<separator> above in the L<Server ! Configuration> section. ! ! =back ! ! =head2 Box Properties ! ! An individual box also has a say as to how it will be rendered as well ! as the content it will have. ! ! The simplest case is a call: ! ! CTX->controller->add_box( 'mypkg::my_box_template' ); ! ! Which simply uses the scalar passed in as the template name and the ! box name, and uses all the defaults. However, you will likely get a ! box with a title 'Generic Box', which is probably not what you want. ! ! Another example: ! ! CTX->controller->add_box({ template => 'mypkg::mybox', ! weight => 1, ! title => 'My First Box' }); ! ! Each box can define the following parameters: ! ! =over 4 ! ! =item * ! ! B<name> ($) ! ! Just used to identify the box; if not provided we use the 'template' ! parameter. ! ! =item * ! ! B<title> ($) (optional) ! ! Display name of box used in the 'shell' wrapper, if you elect to use ! that. ! ! =item * ! ! B<title_key> ($) (optional) ! ! Localization key to use for box title, generally used in place of ! 'title' and if both are present this will be used. ! ! =item * ! ! B<title_image_src> ($) (optional) ! ! Display an image for the title to be used in the 'shell' wrapper. ! ! =item * ! ! B<title_image_src_key> ($) (optional) ! ! Localization key to use for image title, generally used in place of ! 'title_image_src' and if both are present this will be used. ! ! =item * ! ! B<title_image_alt> ($) (optional) ! ! Text to put in the 'alt' tag if using an image in the title. ! ! =item * ! ! B<title_image_alt_key> ($) (optional) ! ! Localization key to use for the 'alt' tag in the image title, ! generally used in place of 'title_image_alt' and if both are present ! this will be used. ! ! =item * ! ! B<weight> ($) ! ! Number between 1 (top) and 10 (bottom) indicating where you want the ! box to be. If you do not specify the weight the constant from this ! class DEFAULT_BOX_WEIGHT will be used. (Normally this is 5.) ! ! =item * ! ! B<box_template> ($) (optional) ! ! If you specify the keyword '_blank_' then your box content will be ! 'naked' and not wrapped by anything else. If you leave this empty you ! will use either the box_template property in your theme, the ! 'box_template' defined in your server configuration, or the ! DEFAULT_TEMPLATE defined in this class. ! ! =item * ! ! B<params> (\%) (optional) ! ! Whatever you pass here will passed through to the template or method ! that is implementing the box. ! ! =back ! ! =head1 TO DO ! ! B<Cache base templates (wrappers)> ! ! The base template wrapper should be cached in the handler so we do not ! need to fetch it every time. ! ! B<Flexible base_template handling> ! ! Right now we allow you to use either the default base_template wrapper ! (defined in either the theme or the server config) or none at all. We ! need to allow each box to define its own wrapper. =head1 SEE ALSO --- 220,227 ---- OpenInteract2::Action::Box -- Handle input and output for independent "boxes" =head1 DESCRIPTION ! See L<OpenInteract2::App::BaseBox> for information about manipulating ! boxes. =head1 SEE ALSO |
From: Chris W. <la...@us...> - 2005-03-29 02:36:32
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_box/OpenInteract2/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13339/OpenInteract2/App Modified Files: BaseBox.pm Log Message: OIN-58: add examples and more info about creating a box to OI2::App::BaseBox; cleanup the boxes action; update message keys to lose the '.label' Index: BaseBox.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/OpenInteract2/App/BaseBox.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BaseBox.pm 10 Mar 2005 01:24:56 -0000 1.2 --- BaseBox.pm 29 Mar 2005 02:36:22 -0000 1.3 *************** *** 48,65 **** =head1 SYNOPSIS ! # Deposit all boxes in the current location on the page: [% OI.action_execute( 'boxes' ) %] - # Define global box information in your server.ini - [box] - handler = MyWebsite::Handler::Box - default_template = base_box::main_box_shell - default_separator = <br> - default_method = run_box - system_box_handler = MyWebsite::Handler::SystemBoxes - system_box_method = - custom_box_handler = - custom_box_method = - # Define an OI action (in conf/action.ini) to be used for a box with # a class and method: --- 48,55 ---- =head1 SYNOPSIS ! # Deposit all boxes accumulated during request in the current ! # location on the page: [% OI.action_execute( 'boxes' ) %] # Define an OI action (in conf/action.ini) to be used for a box with # a class and method: *************** *** 70,82 **** title = Current Weather ! # Add a box ('name' maps to the above OI action): my $zip = $self->request->auth_user->{zipcode}; ! my $box = { name => 'current_weather_box', ! weight => 2, ! title => "Weather in Zip Code $zip", ! params => { zip_code => $zip }; ! $self->controller->add_box( $box ); ! # Add the same box from a template: [% user_zip = OI.login.zip_code; OI.box_add( 'current_weather_box', --- 60,74 ---- title = Current Weather ! # Add the box in code ('name' maps to the above OI action): my $zip = $self->request->auth_user->{zipcode}; ! my %box = ( ! name => 'current_weather_box', ! weight => 2, ! title => "Weather in Zip Code $zip", ! params => { zip_code => $zip } ! ); ! $self->controller->add_box( \%box ); ! # Add the box from a template: [% user_zip = OI.login.zip_code; OI.box_add( 'current_weather_box', *************** *** 88,107 **** # template-only box: [frequent_links_box] ! name = frequent_links_box ! template = mypkg::box_frequent_links ! weight = 8 ! title = Frequent Links ! security = no ! # Add a template-only box, overriding weight and title: ! my $box = { name => 'frequent_links_box', ! weight => 2, ! title => "Most visited sites" }; ! push $self->controller->add_box( $box ); ! # Add the same box from a template, overriding title: [% OI.box_add( 'frequent_links_box', title = 'Most visited sites' ) %] # Remove a box added in another part of the system $self->controller->remove_box( 'motd' ); --- 80,107 ---- # template-only box: [frequent_links_box] ! template = mypkg::box_frequent_links ! weight = 8 ! title = Frequent Links ! security = no ! # Reference our template-only box, overriding weight and title: ! my %box = ( ! name => 'frequent_links_box', ! weight => 2, ! title => "Most visited sites" ! ); ! $self->controller->add_box( \%box ); ! # Reference the same template-only box from a template, overriding title: [% OI.box_add( 'frequent_links_box', title = 'Most visited sites' ) %] + # Add a non-specified template-only box: + my %box = ( + name => 'myapp::mytemplate', + is_template => 'yes', + ); + $self->controller->add_box( \%box ); + # Remove a box added in another part of the system $self->controller->remove_box( 'motd' ); *************** *** 112,121 **** =head1 DESCRIPTION ! See docs in L<OpenInteract2::Action::Box|OpenInteract2::Action::Box> ! for everything you can do with boxes and how to configure them.. ! =head1 OBJECTS ! No objects created by this package. =head1 ACTIONS --- 112,405 ---- =head1 DESCRIPTION ! Boxes are standalone parcels of content that conform to a particular ! format. The content of a box is simply the result of executing an ! OpenInteract2 action: that action may be a piece of code (method in a ! class) or it may just be a template. ! In either case the box handler (L<OpenInteract2::Action::Box>) sorts ! the boxes and places the content for each in a 'shell' so all the ! boxes look the same -- if you want them to. The standard box looks ! something like this: ! ---------------------- <-- 'shell' ! | BOX TITLE | ! ---------------------- ! | Box content | ! | generated by an | ! | action goes here | ! ---------------------- ! ! But you can create your own shell for all boxes by setting the 'boxes' ! parameter 'default_box_template' or on a per-box basis with the ! parameter 'box_template'. Whichever you choose, the value should be a ! particular template (in the 'package::template_name' format). ! ! =head1 BOX COLLECTION ! ! =head2 Configuration ! ! The L<OpenInteract2::Action::Box> action has a number of configuration ! parameters that define how the collection of boxes are organized and ! how they look. As with all L<OpenInteract2::Action> objects you can ! define these parameters in a configuration file (C<conf/action.ini> in ! the C<base_box> package) or in the object itself. ! ! =over 4 ! ! =item * ! ! B<default_box_template> ($) (optional) ! ! This is the template into which every box content gets put unless it ! specifies otherwise. The default template is ! C<base_box::main_box_shell>, which as the name would indicate is also ! installed with this package. ! ! B<default_box_separator> ($) (optional) ! ! This is the string used to separate boxes. For instance, if you want ! to put a short horizontal rule between each line, you could set this ! to: ! ! default_box_separator = <hr width="50%" noshade/> ! ! Or if you had a custom image you wanted to separate your boxes with: ! ! default_box_separator = <div align="center"><img src="/images/box_sep.gif" height="2" width="25"/></div> ! ! This module defines the default separator as '<br />'. ! ! =item * ! ! B<default_box_weight> ($; optional) ! ! Use as the box weight if unspecified. ! ! =item * ! ! B<system_box_class> ($) (optional) ! ! Defines what we should run on every request to display system ! boxes. Typically this is C<OpenInteract2::Action::SystemBoxes>; see ! L<OpenInteract2::Action::SystemBoxes> for what this includes. ! ! It is okay if you blank this out, you just will not get the 'login', ! 'templates used', 'admin tools' and other boxes on every page. ! ! We call the C<handler()> method on whatever class is defined here. ! ! =item * ! ! B<custom_box_class> ($) (optional) ! ! If you want to call a custom handler to run every time B<in addition ! to> the system handler named above, list the class here. We call the ! C<handler()> method on whatever class is defined here. ! ! =back ! ! =head1 BOX SAMPLES ! ! An individual box also has a say as to how it will be rendered as well ! as the content it will have. We'll go through a few different use ! cases. ! ! =head2 Sample: Standard action ! ! Like we said above, every box is just an action in a different ! format. So say we have an action implementation like this: ! ! package OpenInteract2::Action::InsultUser; ! ! use base qw( OpenInteract2::Action ); ! use OpenInteract2::Context qw( CTX ); ! ! sub insult { ! my ( $self ) = @_; ! my $user = CTX->request->auth_user; ! my $first_name = $user->first_name; ! return ( $user->id % 2 == 0 ) ! ? "$first_name, you stink of elderberries" ! : "$first_name, your mother was a donkey"; ! } ! ! 1; ! ! And our configuration for the box action points to the class and ! method; here's the most basic configuration to which we'll add values ! to see how they're reflected (from the C<conf/action.ini>): ! ! [insult_box] ! class = OpenInteract2::Action::InsultUser ! task = insult ! ! We'd add the box from a template like this -- 'insult_box' is from the ! name of our action: ! ! [% OI.box_add( 'insult_box' ) %] ! ! When invoked by the 'boxes' action this will generate something like: ! ! ---------------------- ! | Generic Box | ! ---------------------- ! | Chris, you stink | ! | of elderberries | ! ---------------------- ! ! Well, 'Generic Box' doesn't really do our box justice. Let's set the ! title ourselves by adding a parameter to the action configuration: ! ! [insult_box] ! class = OpenInteract2::Action::InsultUser ! task = insult ! title = Your Insult ! ! The box will now look like this: ! ! ---------------------- ! | Your Insult | ! ---------------------- ! | Chris, you stink | ! | of elderberries | ! ---------------------- ! ! Surprisingly, our insults wind up attracting worldwide attention and ! people around the world want to see the title in their own ! language. (Our research hasn't yet shown that people actually want the ! insults in their own language...) So instead of hardcoding a title ! we'll use a localization key: ! ! [insult_box] ! class = OpenInteract2::Action::InsultUser ! task = insult ! title_key = Your Insult ! ! And in our localization files we'd have something like: ! ! myapp-en.msg: ! Your Insult = Your Insult ! ! myapp-es.msg: ! Your Insult = Su Insulto ! ! So if I login with my browser's preferred language set to Spanish ! ('es') I'd see: ! ! ---------------------- ! | Su Insulto | ! ---------------------- ! | Chris, you stink | ! | of elderberries | ! ---------------------- ! ! See below for all the other properties you can assign. ! ! =head2 Sample: Template-only, no parameteters ! ! The simplest case is a call: ! ! CTX->controller->add_box( 'mypkg::my_box_template' ); ! ! Which simply uses the scalar passed in as the template name and the ! box name, and uses all the defaults. However, you will likely get a ! box with a title 'Generic Box', which is probably not what you want. ! ! Just in case you thought that template-only boxes were an exception to ! the 'every box is an action' rule: underneath the hood we create an ! action of type 'template_only' and just assign the parameter ! 'template' as the template name you pass in. ! ! =head2 Sample: Template-only, parameters ! ! Another example -- this time you have to set your template as the ! parameter 'template' since you've got other parameters: ! ! CTX->controller->add_box({ ! name => 'mypkg::mybox', ! weight => 1, ! title => 'My First Box' ! }); ! ! =head1 BOX PROPERTIES ! ! Every box can define the following properties: ! ! B<name> ($) ! ! Name of the action that will generate the content for this box or it ! may also be the name of the template for this box. ! ! B<box_name> ($) ! ! Solely used to identify the box; if not provided we use the 'name' ! parameter. This is useful if you've got two boxes referencing the same ! template but with different content. ! ! For instance, say you had a box 'weather' that displayed weather ! information for a location. And that on one page you had boxes for two ! locations: ! ! [% OI.add_box( 'weather', ! box_name = 'pgh weather', zip = '15216'); ! OI.add_box( 'weather', ! box_name = 'silver spring weather', zip = '29010' }); %] ! ! If you later wanted to remove one of the boxes you'd be able to delete ! only the first like this and leave the other untouched: ! ! [% OI.remove_box( 'pgh weather' ) %] ! ! B<title> ($) (optional) ! ! Display name of box used in the 'shell' wrapper, if you elect to use ! that. ! ! B<title_key> ($) (optional) ! ! Localization key to use for box title, generally used in place of ! 'title' and if both are present this will be used. ! ! B<title_image_src> ($) (optional) ! ! Display an image for the title to be used in the 'shell' wrapper. ! ! B<title_image_src_key> ($) (optional) ! ! Localization key to use for image title, generally used in place of ! 'title_image_src' and if both are present this will be used. ! ! B<title_image_alt> ($) (optional) ! ! Text to put in the 'alt' tag if using an image in the title. ! ! B<title_image_alt_key> ($) (optional) ! ! Localization key to use for the 'alt' tag in the image title, ! generally used in place of 'title_image_alt' and if both are present ! this will be used. ! ! B<weight> ($) ! ! Number between 1 (top) and 10 (bottom) indicating where you want the ! box to be. If you do not specify the weight the C<default_box_weight> ! action parameter will be used; if that's not defined the world is an ! uncertain place. ! ! B<box_template> ($) (optional) ! ! If you specify the keyword '_blank_' then your box content will be ! 'naked' and not wrapped by anything else. If you leave this empty you ! will use the template specified in the 'default_box_template' action ! parameter. ! ! =item * ! ! B<*> or B<\%params> (optional) ! ! Any additional parameters, or parameters specified in C<\%params>, ! will be passed through to the action generating the box content. ! ! =back =head1 ACTIONS *************** *** 130,135 **** B<object_modify_box> ! Box for editing/removing an object. (Has aliases 'object_mod_box' and ! 'objectmodbox'.) B<login_box> --- 414,418 ---- B<object_modify_box> ! Generic box for editing/removing an object. B<login_box> *************** *** 150,157 **** (mod_perl, Template Toolkit, OpenInteract). - =head1 RULESETS - - No rulesets created by this package. - =head1 AUTHORS --- 433,436 ---- |
From: Chris W. <la...@us...> - 2005-03-29 02:36:32
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_box/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13339/conf Modified Files: action.ini Log Message: OIN-58: add examples and more info about creating a box to OI2::App::BaseBox; cleanup the boxes action; update message keys to lose the '.label' Index: action.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/conf/action.ini,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** action.ini 17 Mar 2005 15:45:29 -0000 1.6 --- action.ini 29 Mar 2005 02:36:22 -0000 1.7 *************** *** 1,13 **** [boxes] ! class = OpenInteract2::Action::Box ! method = process_boxes ! is_secure = no ! box_default_method = handler ! box_default_separator = <br>\n ! box_default_template = base_box::main_box_shell ! box_default_box_weight = 5 ! box_max_box_weight = 100 ! box_blank_shell_template = _blank_ ! [object_modify_box] template = base_box::object_modify_box --- 1,20 ---- [boxes] ! class = OpenInteract2::Action::Box ! method = process_boxes ! is_secure = no ! max_box_weight = 100 ! blank_box_template = _blank_ ! system_box_class = OpenInteract2::Action::SystemBoxes ! custom_box_class = ! box_separator = <br /> ! default_box_template = base_box::main_box_shell ! default_weight = 5 ! default_title = Generic Box ! default_title_key = ! default_title_image_src = ! default_title_image_src_key = ! default_title_image_alt = ! default_title_image_alt_key = ! [object_modify_box] template = base_box::object_modify_box |
From: Chris W. <la...@us...> - 2005-03-29 02:36:32
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_box/msg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13339/msg Modified Files: base_box-messages-no.msg base_box-messages-en.msg Log Message: OIN-58: add examples and more info about creating a box to OI2::App::BaseBox; cleanup the boxes action; update message keys to lose the '.label' Index: base_box-messages-no.msg =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/msg/base_box-messages-no.msg,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** base_box-messages-no.msg 18 Mar 2005 17:16:33 -0000 1.4 --- base_box-messages-no.msg 29 Mar 2005 02:36:22 -0000 1.5 *************** *** 1,23 **** # Messages for the 'base_box' package: Norwegian ! admin_tools_box.label.error_browser = <a href="[_1]">Feil-logg</a> ! admin_tools_box.label.group = Grupper (<a href="[_1]">Vis alle</a> | <a href="[_2]">Lag ny</a>) ! admin_tools_box.label.lookup = <a href="[_1]">Liste over tabeller</a> ! admin_tools_box.label.activity = <a href="[_1]">Aktivitetslogg</a> ! admin_tools_box.label.page = <a href="[_1]">Sideadministrasjon</a> ! admin_tools_box.label.security = <a href="[_1]">Tilgangskontroll</a> ! admin_tools_box.label.template = Side-maler (<a href="[_1]">Vis alle</a> | <a href="[_2]">Lag ny</a>) ! admin_tools_box.label.doc = <a href="[_1]">Systemdokumentasjon</a> ! admin_tools_box.label.theme = Fargeprofiler (<a href="[_1]">Vis alle</a> | <a href="[_2]">Lag ny</a>) ! admin_tools_box.label.user = Brukere (<a href="[_1]">Søk</a> | <a href="[_2]">Lag ny</a>) admin_tools_box.title = Administrasjons-verktøy login_box.no_account = Ingen konto? <a href="[_1]">Lag en ny!</a> ! login_box.label.name = Brukernavn ! login_box.label.password = Passord ! login_box.label.remember = Ikke spør om passord fra nå av ! login_box.label.forgot = Glemt passord? login_box.button.login = Logg inn login_box.title = Logg inn ! object_modify_box.label.edit_security = Endre sikkerhetsnivå ! object_modify_box.label.edit_topics = Endre titler object_modify_box.summary = Ingen operasjoner tillatt. object_modify_box.not_entered = Siden dette objektet ikke enda er lagt til \ --- 1,23 ---- # Messages for the 'base_box' package: Norwegian ! admin_tools_box.error_browser = <a href="[_1]">Feil-logg</a> ! admin_tools_box.group = Grupper (<a href="[_1]">Vis alle</a> | <a href="[_2]">Lag ny</a>) ! admin_tools_box.lookup = <a href="[_1]">Liste over tabeller</a> ! admin_tools_box.activity = <a href="[_1]">Aktivitetslogg</a> ! admin_tools_box.page = <a href="[_1]">Sideadministrasjon</a> ! admin_tools_box.security = <a href="[_1]">Tilgangskontroll</a> ! admin_tools_box.template = Side-maler (<a href="[_1]">Vis alle</a> | <a href="[_2]">Lag ny</a>) ! admin_tools_box.doc = <a href="[_1]">Systemdokumentasjon</a> ! admin_tools_box.theme = Fargeprofiler (<a href="[_1]">Vis alle</a> | <a href="[_2]">Lag ny</a>) ! admin_tools_box.user = Brukere (<a href="[_1]">Søk</a> | <a href="[_2]">Lag ny</a>) admin_tools_box.title = Administrasjons-verktøy login_box.no_account = Ingen konto? <a href="[_1]">Lag en ny!</a> ! login_box.name = Brukernavn ! login_box.password = Passord ! login_box.remember = Ikke spør om passord fra nå av ! login_box.forgot = Glemt passord? login_box.button.login = Logg inn login_box.title = Logg inn ! object_modify_box.edit_security = Endre sikkerhetsnivå ! object_modify_box.edit_topics = Endre titler object_modify_box.summary = Ingen operasjoner tillatt. object_modify_box.not_entered = Siden dette objektet ikke enda er lagt til \ *************** *** 27,32 **** powered_by_box.summary = Dette nettstedet benytter seg av følgende teknologier: powered_by_box.title = Teknologiplattform ! user_info_box.label.customize = Endre info ! user_info_box.label.signout = Logg ut ! user_info_box.label.no_login = Du er ikke logget inn user_info_box.title = Info om meg --- 27,32 ---- powered_by_box.summary = Dette nettstedet benytter seg av følgende teknologier: powered_by_box.title = Teknologiplattform ! user_info_box.customize = Endre info ! user_info_box.signout = Logg ut ! user_info_box.no_login = Du er ikke logget inn user_info_box.title = Info om meg Index: base_box-messages-en.msg =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/msg/base_box-messages-en.msg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** base_box-messages-en.msg 17 Mar 2005 12:52:22 -0000 1.3 --- base_box-messages-en.msg 29 Mar 2005 02:36:22 -0000 1.4 *************** *** 1,22 **** # Messages for the 'base_box' package: English ! admin_tools_box.label.error_browser = <a href="[_1]">Error Browser</a> ! admin_tools_box.label.group = Group (<a href="[_1]">List</a> | <a href="[_2]">New</a>) ! admin_tools_box.label.lookup = <a href="[_1]">Lookup Tables</a> ! admin_tools_box.label.activity = <a href="[_1]">Object Activity</a> ! admin_tools_box.label.page = <a href="[_1]">Page actions</a> ! admin_tools_box.label.security = <a href="[_1]">Security</a> ! admin_tools_box.label.template = Template (<a href="[_1]">List</a> | <a href="[_2]">New</a>) ! admin_tools_box.label.doc = <a href="[_1]">System documentation</a> ! admin_tools_box.label.theme = Theme (<a href="[_1]">List</a> | <a href="[_2]">New</a>) ! admin_tools_box.label.user = User (<a href="[_1]">Search</a> | <a href="[_2]">New</a>) login_box.no_account = No account? <a href="[_1]">Create one!</a> ! login_box.label.name = Name ! login_box.label.password = Password ! login_box.label.remember = Remember me ! login_box.label.forgot = Forgot password? login_box.button.login = Login login_box.title = Login ! object_modify_box.label.edit_security = Edit object security ! object_modify_box.label.edit_topics = Edit object topics object_modify_box.summary = No actions for you to take on this object. object_modify_box.not_entered = Since this object has not yet been entered in the system, \ --- 1,23 ---- # Messages for the 'base_box' package: English ! admin_tools_box.title = Admin Tools ! admin_tools_box.error_browser = <a href="[_1]">Error Browser</a> ! admin_tools_box.group = Group (<a href="[_1]">List</a> | <a href="[_2]">New</a>) ! admin_tools_box.lookup = <a href="[_1]">Lookup Tables</a> ! admin_tools_box.activity = <a href="[_1]">Object Activity</a> ! admin_tools_box.page = <a href="[_1]">Page actions</a> ! admin_tools_box.security = <a href="[_1]">Security</a> ! admin_tools_box.template = Template (<a href="[_1]">List</a> | <a href="[_2]">New</a>) ! admin_tools_box.doc = <a href="[_1]">System documentation</a> ! admin_tools_box.theme = Theme (<a href="[_1]">List</a> | <a href="[_2]">New</a>) ! admin_tools_box.user = User (<a href="[_1]">Search</a> | <a href="[_2]">New</a>) login_box.no_account = No account? <a href="[_1]">Create one!</a> ! login_box.name = Name ! login_box.password = Password ! login_box.remember = Remember me ! login_box.forgot = Forgot password? login_box.button.login = Login login_box.title = Login ! object_modify_box.edit_security = Edit object security ! object_modify_box.edit_topics = Edit object topics object_modify_box.summary = No actions for you to take on this object. object_modify_box.not_entered = Since this object has not yet been entered in the system, \ *************** *** 26,31 **** powered_by_box.summary = This website is powered by the following technologies: powered_by_box.title = Powered By ! user_info_box.label.customize = Customize ! user_info_box.label.signout = Sign Out ! user_info_box.label.no_login = You are not logged in user_info_box.title = Your Info --- 27,32 ---- powered_by_box.summary = This website is powered by the following technologies: powered_by_box.title = Powered By ! user_info_box.customize = Customize ! user_info_box.signout = Sign Out ! user_info_box.no_login = You are not logged in user_info_box.title = Your Info |