The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Rose::DBx::Garden::Catalyst::Controller - base Controller class

DESCRIPTION

Rose::DBx::Garden::Catalyst::Controller is a subclass of CatalystX::CRUD::Controller::RHTMLO with some additional/overridden methods for working with YUI and JSON.

METHODS

json_mime

Returns JSON MIME type. Default is 'application/json; charset=utf-8'.

auto

Fix up some YUI parameter names and stash the form object. See the Catalyst documentation for other special features of the auto() Private method.

default

Redirects to URI for 'count' in same namespace.

yui_datatable( context, arg )

Public URI method. Like calling search() but returns JSON in format the YUI DataTable expects.

yui_datatable_count( context, arg )

Public URI method. Like calling count() but returns JSON in format the YUI DataTable expects.

Public URI method. Returns JSON like yui_datatable but for the records referred to by relationship_name.

rm_m2m( rel_name, foreign_pk, foreign_pk_value )

Remove a ManyToMany-related record. Chained to fetch() just like the other CRUD methods are.

The content response is 'Ok' on success, or a generic error string on failure.

IMPORTANT: This URI is for ManyToMany only. Using it on OneToMany or ManyToOne rel_name values will delete the related row altogether.

add_m2m( rel_name, foreign_pk, foreign_pk_value )

Add a ManyToMany-related record. Chained to fetch() just like the other CRUD methods are.

The content response is the new record as JSON on success, or a generic error string on failure.

form_to_object

Overrides the base CRUD method to catch errors if the expected return format is JSON.

precommit

Overrides the base method to double-check that all int-type fields of zero length() are set to undef. This addresses a RHTMLO bug that is supposedly fixed in version 0.552 and later.

postcommit

Overrides base method to render response as JSON where necessary. The return request param is checked for the string 'json' and the object is serialized accordingly.

autocomplete_columns

Should return arrayref of fields to search when the autocomplete() URI method is requested.

The default is all the unique keys in model_name() that are made up of a single column.

autocomplete_method

Which method should be called on each search result to create the response list.

Default is the first item in autocomplete_columns().

autocomplete( context )

Public URI method. Supports the Rose::HTMLx::Form::Field::Autocomplete API.

AUTHOR

Peter Karman, <karman at cpan.org>

BUGS

Please report any bugs or feature requests to bug-rose-dbx-garden-catalyst at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Rose-DBx-Garden-Catalyst. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Rose::DBx::Garden::Catalyst

You can also look for information at:

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.