The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CatalystX::CMS - drop-in content management system

SYNOPSIS

 package MyApp;
 
 # ...
 
 MyApp->config(
    cms => {
        model_name             => 'CMS',
        view_name              => 'CMS',
        actionclass_per_action => 0,
        use_editor             => 1,
        use_layout             => 1,
        editor                 => {
            height => '300',
            width  => '550',
        },
        default_type    => 'html',
        default_flavour => 'default',
        lock_period     => 3600,
        root => {
            r  => [
                MyApp->path_to('root')
            ],
            rw => [
                '/path/to/svn/workdir'
            ]
        }
                
    }
 );
 
 MyApp->setup;

 # elsewhere, in a controller
 
 package MyApp::Controller::Foo;
 use strict;
 use base qw( CatalystX::CMS::Controller );
 
 sub bar : Local {
    # ...
 }
 
 1;

DESCRIPTION

CatalystX::CMS is a drop-in content management system that allows you to manage your Catalyst app templates via a web-based editor.

METHODS

Only new or overridden method are documented here.

PUT( c, controller, cmspage )

Calls do_action().

POST( c, controller, cmspage )

Calls create().

GET( c, controller, cmspage )

Calls the method named in the stash() in c under the key cms_mode. cms_mode is typically set by CatalystX::CMS::Action->execute().

DELETE( c, controller, cmspage )

Calls delete().

unlock

 TODO
 

get_user( c )

Returns a username to associate with the lock on a file.

If c has a user method (as if using Catalyst::Plugin::Authentication), calls the user->id method chain.

Otherwise, returns anonymous.

history( c, controller, cmspage )

Available as a cms_mode method.

Display svn history of cmspage.

diff( c, controller, cmspage )

Available as a cms_mode method.

Display svn diff of cmspage. If the rev request param is present, the difference between that value and the previous revision is used.

blame( c, controller, cmspage )

Available as a cms_mode method.

Display svn blame of cmspage.

create( c, controller, cmspage )

Available only via HTTP POST.

Calls create() method on cmspage passing get_user() for lock owner.

Sets redirect uri for edit().

edit( c, controller, cmspage )

Available as a cms_mode method.

Verifies lock on cmspage, extending it if necessary, and displays the cms editor template.

do_action( c, controller, cmspage )

Called by PUT(). Calls cms_mode like GET() does, but checks lock on cmspage first.

do_action() is typically called for save()ing a cmspage.

cancel( c, controller, cmspage )

Available as a cms_mode method.

Reverts any local changes to cmspage and unlocks the page.

If cmspage has never been committed to the svn repository, the file will be removed.

validate( c, controller, cmspage )

Called by save() to verify that cmspage has correct TT syntax.

If strict_html mode is set and the type() of cmspage is html XML::LibXML is used to verify that cmspage parses correctly.

save( c, controller, cmspage )

Available as a cms_mode method.

Typically called by do_action() via PUT().

preview( c, controller, cmspage )

Available as a cms_mode method.

Like save() but with no commit() and preserves lock

delete( c, controller, cmspage )

Available as a cms_mode method.

Called by DELETE(). Removes lock on cmspage and deletes the file from the local workspace and from the svn repository. See also cancel().

AUTHOR

Peter Karman, <karman@cpan.org>

BUGS

Please report any bugs or feature requests to bug-catalystx-cms@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.

COPYRIGHT & LICENSE

Copyright 2008 by the Regents of the University of Minnesota.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.