CatalystX::CRUD::YUI::Controller - base controller
package MyApp::Controller::Foo; use strict; # ISA order is important use base qw( CatalystX::CRUD::YUI::Controller CatalystX::CRUD::Controller::RHTMLO ); __PACKAGE__->config( autocomplete_columns => [qw( foo bar )], autocomplete_method => 'foo', hide_pk_columns => 1, fuzzy_search => 0, default_view => 'YUI', fmt_to_view_map => { 'html' => 'YUI', 'json' => 'YUI', 'xls' => 'Excel', }, ); 1;
This is a base controller class for use with CatalystX::CRUD::YUI applications. It implements URI and internal methods that the accompanying .tt and .js files rely upon.
NOTE: As of version 0.008 this class drops support for the YUI datatable feature and instead supports the ExtJS LiveGrid feature.
See SYNOPSIS for config options specific to this class.
See the autocomplete_columns() method. Value should be an array ref.
See the autocomplete_method() method. Value should be a method name.
Used in the LiveGrid class. Boolean setting indicating whether the primary key column(s) should appear in the YUI LiveGrid listings or not. Default is true.
If true, the cxc-fuzzy param will be appended to all search queries via the .tt files. See CatalystX::CRUD::Model::Utils for more documentation about the cxc-fuzzy param.
cxc-fuzzy
The name of the View to use if cxc-fmt is not specified. This should be the name of a View that inherits from CatalystX::CRUD::YUI::View. The default is 'YUI'.
cxc-fmt
Hash ref of cxc-fmt types to View names. Used in end() to determine which View to set.
Only new or overridden method are documented here.
Overrides base method just to call next::method and ensures config() gets merged correctly.
Returns JSON MIME type. Default is 'application/json; charset=utf-8'.
Redirects to URI for 'count' in same namespace.
Public URI method. Returns JSON for ExtJS LiveGrid feature.
Returns plain HTML form without wrapper for use with LiveGrid relationship manager.
Lke livegrid_create_form but returns form initialized for record represented by oid. Chained to fetch().
Sets up stash() to mimic the foreign controller represented by relationship_name.
Overrides superclass method to set the content response to 'Ok' on success, or a generic error string on failure.
CAUTION: This URI is for ManyToMany only. Using it on OneToMany or ManyToOne rel_name values will delete the related row altogether.
Overrides superclass method to return the new record as JSON on success, or a generic error string on failure.
Overrides the base CRUD method to catch errors if the expected return format is JSON.
Overrides base method to re-read object from db.
Should return arrayref of fields to search when the autocomplete() URI method is requested.
Set this value in config(). Default is a no-op.
Which method should be called on each search result to create the response list.
Default is the first item in autocomplete_columns().
Public URI method. Supports the Rose::HTMLx::Form::Field::Autocomplete API.
Uses the RenderView ActionClass.
Prior to passing to view, sets current_view if it is not set, based on the cxc-fmt request parameter, defaulting to 'YUI'.
current_view
NOTE:This assumes you have a View class called YUI that inherits from CatalystX::CRUD::YUI::View.
YUI
Peter Karman, <karman@cpan.org>
<karman@cpan.org>
Please report any bugs or feature requests to bug-catalystx-crud-yui@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.
bug-catalystx-crud-yui@rt.cpan.org
The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.
http://www.msi.umn.edu/
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.
To install CatalystX::CRUD::YUI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::CRUD::YUI
CPAN shell
perl -MCPAN -e shell install CatalystX::CRUD::YUI
For more information on module installation, please visit the detailed CPAN module installation guide.