Why not adopt me?
NAME
Maypole::Plugin::ColumnGroups - set up column groups in Maypole
SYNOPSIS
use Maypole::Application qw( ColumnGroups -Debug2 );
# Maypole will use the column 'name' or 'title', if it exists, or a primary
# key column that is not called 'id'. Otherwise, you need to tell Maypole
# what column to stringify objects to:
__PACKAGE__->config->column_groups( { Stringify => { person => 'first_name' },
car => 'model' },
widget => 'part_no' },
} } );
__PACKAGE__->column_groups( { Editor => { article => [ qw( content keywords publish location ) ],
finance => [ qw( invoice credit bribe entertainment ) ],
},
Writer => { article => [ qw( content keywords ) ] },
Reviewer => { article => [ qw( rating ) ] },
} );
#
# An example using Maypole::Plugin::Config::Apache:
#
PerlAddVar MaypoleColumnGroups "Stringify => { person => 'first_name' }"
PerlAddVar MaypoleColumnGroups "Stringify => { car => 'model' }"
PerlAddVar MaypoleColumnGroups "Stringify => { widget => 'part_no' }"
PerlAddVar MaypoleColumnGroups "Editor => { article => [ qw( content keywords publish location ) ] }"
PerlAddVar MaypoleColumnGroups "Editor => { finance => [ qw( invoice credit bribe entertainment ) ] }"
PerlAddVar MaypoleColumnGroups "Writer => { article => [ qw( content keywords ) ] }"
PerlAddVar MaypoleColumnGroups "Reviewer => { article => [ qw( rating ) ] }"
DESCRIPTION
Maypole use the Stringify
column group to decide which column to use when, for example, displaying a link to an object. If there is no Stringify
group, Maypole defaults to using the column 'name' or 'title', if it exists, or a primary key column that is not called 'id'. Otherwise, you need to tell Maypole what column to stringify objects on.
Authorization could make heavy use of column groups to decide who has access to what columns of different tables. It's easy enough to set up column groups by hand, but it's also useful to be able to stuff all that information into the configuration data.
Setting the Debug
flag to 2 or higher will print some info to STDERR
to confirm how the groups have been set up.
METHODS
- setup
AUTHOR
David Baird, <cpan@riverside-cms.co.uk>
BUGS
Please report any bugs or feature requests to bug-maypole-plugin-columngroups@rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Maypole-Plugin-ColumnGroups. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2005 David Baird, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.