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

NAME

Catalyst::Controller::DBIC::API::StaticArguments - Provides controller level configuration arguments

VERSION

version 2.004004

DESCRIPTION

StaticArguments is a Role that is composed by the controller to provide configuration parameters such as how where in the request data to find specific elements, and if to use JSON boolean types.

PUBLIC_ATTRIBUTES

create_requires create_allows update_requires update_allows

These attributes control requirements and limits to columns when creating or updating objects.

Each provides a number of handles:

    "get_${var}_column" => 'get'
    "set_${var}_column" => 'set'
    "delete_${var}_column" => 'delete'
    "insert_${var}_column" => 'insert'
    "count_${var}_column" => 'count'
    "all_${var}_columns" => 'elements'

prefetch_allows is: ro, isa: ArrayRef[ArrayRef|Str|HashRef]

prefetch_allows limits what relations may be prefetched when executing searches with joins. This is necessary to avoid denial of service attacks in form of queries which would return a large number of data and unwanted disclosure of data.

Like the synopsis in DBIC::API shows, you can declare a "template" of what is allowed (by using an '*'). Each element passed in, will be converted into a Data::DPath and added to the validator.

    prefetch_allows => [ 'cds', { cds => tracks }, { cds => producers } ] # to be explicit
    prefetch_allows => [ 'cds', { cds => '*' } ] # wildcard means the same thing

count_arg is: ro, isa: Str, default: 'list_count'

count_arg controls how to reference 'count' in the the request_data

page_arg is: ro, isa: Str, default: 'list_page'

page_arg controls how to reference 'page' in the the request_data

offset_arg is: ro, isa: Str, default: 'list_offset'

offset_arg controls how to reference 'offset' in the the request_data

select_arg is: ro, isa: Str, default: 'list_returns'

select_arg controls how to reference 'select' in the the request_data

as_arg is: ro, isa: Str, default: 'as'

as_arg controls how to reference 'as' in the the request_data

search_arg is: ro, isa: Str, default: 'search'

search_arg controls how to reference 'search' in the the request_data

grouped_by_arg is: ro, isa: Str, default: 'list_grouped_by'

grouped_by_arg controls how to reference 'grouped_by' in the the request_data

ordered_by_arg is: ro, isa: Str, default: 'list_ordered_by'

ordered_by_arg controls how to reference 'ordered_by' in the the request_data

prefetch_arg is: ro, isa: Str, default: 'list_prefetch'

prefetch_arg controls how to reference 'prefetch' in the the request_data

stash_key is: ro, isa: Str, default: 'response'

stash_key controls where in stash request_data should be stored

data_root is: ro, isa: Str, default: 'list'

data_root controls how to reference where the data is in the the request_data

item_root is: ro, isa: Str, default: 'data'

item_root controls how to reference where the data for single object requests is in the the request_data

total_entries_arg is: ro, isa: Str, default: 'totalcount'

total_entries_arg controls how to reference 'total_entries' in the the request_data

use_json_boolean is: ro, isa: Bool, default: 0

use_json_boolean controls whether JSON boolean types are used in the success parameter of the response or if raw strings are used

return_object is: ro, isa: Bool, default: 0

return_object controls whether the results of create/update are serialized and returned in the response

AUTHORS

  • Nicholas Perez <nperez@cpan.org>

  • Luke Saunders <luke.saunders@gmail.com>

  • Alexander Hartmaier <abraxxa@cpan.org>

  • Florian Ragwitz <rafl@debian.org>

  • Oleg Kostyuk <cub.uanic@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Luke Saunders, Nicholas Perez, Alexander Hartmaier, et al..

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