Name

CatalystX::Usul::Plugin::Model::StashHelper - Convenience methods for stuffing the stash

Version

0.5.$Revision: 1139 $

Synopsis

package CatalystX::Usul;
use parent qw(CatalystX::Usul::Base CatalystX::Usul::File);

package CatalystX::Usul::Model;
use parent qw(Catalyst::Model CatalystX::Usul);

package YourApp::Model::YourModel;
use parent qw(CatalystX::Usul::Model);

Description

Many convenience methods for stuffing/resetting the stash. The form widget definitions will be replaced later by the form building method which is called from the HTML view

Subroutines/Methods

add_append

Stuff some content into the stash so that it will appear in the append div in the template. The content is a hash ref which will be interpreted as a widget definition by the form builder which is invoked by the HTML view. Multiple calls push the content onto a stack which is rendered in the order in which it was stacked

add_button

Add a button definition to the stash. The template will render these as image buttons on the button div

add_buttons

Loop around "add_button"

add_chooser

Generates the data for the popup chooser window which allows a data value to be selected from a list produced by some query. It is intended as a replacement for a popup menu widget where the list of values would be prohibitively long

add_error

Stringifies the passed error object, localises the text, logs it as an error and calls "add_result" to display it at the top of the sdata div

add_error_msg

Localises the message text, creates a new error object and calls "add_error"

add_field

Create a widget definition for a form field

Adds data for a horizontal rule to separate the footer from the rest of the content

add_header

Stuffs the stash with the data for the page header

add_hidden

Adds a hidden field to the form

add_result

Adds the result of forwarding to an an action. This is the result div in the template

add_result_msg

Localises the message text and calls "add_result"

add_search_hit

Placeholder should have been implemented in the class that applies this role

Adds the sequence of links used in search page results; first page, previous page, list of pages around the current one, next page, and last page

add_sidebar_panel

Stuffs the stash with the data necessary to create a panel in the accordion widget on the sidebar

check_field_wrapper

$model->check_field_wrapper;

Extract parameters from the query and call check_field. Stash the result

clear_append

Clears the stash of the widget data used by the region appended to the main data store

clear_buttons

Clears button data from the stash

clear_controls

Groups the methods that clear the stash of data not used in a minority of pages

Clears all footer data. Called by "add_footer"

clear_form

Initialises the sdata div contents. Called by /stash_content on first use

clear_header

Clears the header data from the form

clear_hidden

Clears the hidden fields from the form

clear_menus

Clears the stash of the main navigation and tools menu data

Clears the stash of the quick links navigation data

clear_result

Clears the stash of messages from the output of actions

clear_sidebar

Clears the stash of the data used by the sidebar accordion widget

form_wrapper

Stashes the data used by HTML::FormWidgets to throw form around a group of fields

get_para_col_class

$column_class = $model_obj->get_para_col_class( $n_columns );

Converts an integer number into a string representation

group_fields

Stashes the data used by HTML::FormWidgets to throw a fieldset around a group of fields

search_for

Placeholder returns an instance of Class::Null. Should have been implemented in the interface model subclass

search_page

Create a KinoSearch results page

stash_content

Pushes the content (usually a widget definition) onto the specified stack. Defaults the sdata stack

stash_meta

Adds some meta data to the response for an Ajax call

stash_para_col_class

$column_class = $model_obj->stash_para_col_class( $key, $n_columns );

Calls and returns the value from "get_para_col_class". Also stashes the value in the $key attribute

update_group_membership

$bool = $model_obj->update_group_membership( $args );

Adds/removes lists of attributes from groups

Returns a content hash ref that renders as a clickable image anchor. The link returns to the web servers default page

Adds a horizontal rule to separate the footer. Called by "add_footer"

Configuration and Environment

None

Diagnostics

None

Dependencies

CatalystX::Usul
Data::Pageset
Lingua::Flags
Time::Elapsed

Incompatibilities

There are no known incompatibilities in this module.

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Author

Peter Flanigan, <Support at RoxSoft.co.uk>

License and Copyright

Copyright (c) 2008 Peter Flanigan. All rights reserved

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

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE