OpusVL::AppKit::RolesFor::Controller::GUI
version 2.24
package MyApp::Controller::SomeFunkyThing; use Moose; BEGIN{ extends 'Catalyst::Controller' }; with 'OpusVL::AppKit::RolesFor::Controller::GUI'; __PACKAGE__->config( appkit_name => 'My Funky App' ); __PACKAGE__->config( appkit_icon => 'static/funkster/me.gif' ); __PACKAGE__->config( appkit_myclass => 'MyApp' ); sub index :Path :Args(0) :NavigationHome :NavigationName("Funky Home") :PortletName("Funky Portlet") :AppKitForm { # .. do some funky stuff .. }
If you use this Moose::Role with a controller it can be intergrated into the OpusVL::AppKit. You can just do: use Moose; with 'OpusVL::AppKit::RolesFor::Controller::GUI'; Give your Controller a name within the GUI: __PACKAGE__->config( appkit_name => 'Some Name' ); To make use of the additional features you will have to use one of the following action method attributes: NavigationHome This tells the GUI this action is the 'Home' action for this controller. NavigationName Tells the GUI this action is a navigation item and what its name should be. PortletName Tells the GUI this action is a portlet action, so calling is only garented to fill out the 'portlet' stash key. AppKitForm Behaves like FormConfig option in FormFu Controller, except it loads form from the ShareDir of namespace passed in 'appkit_myclass' SearchName Tells the GUI this action is a search action and what its name should be
OpusVL::AppKit::RolesFor::Controller::GUI - Role for Controllers wanting to interact with AppKit
This should be the hash of action details that pertain the the 'home action' of a controller. If there is none defined for a controller, it should be undef.
This should be an Array Ref of HashRef's pertaining the actions that make up the navigation
This should be an Array Ref of HashRef's pertaining the actions that make up the navigation grouped by appkit_method_group.
This should be an Array Ref of HashRef's pertaining the actions that are Portlet's
Hook into the creation of the actions. Here we read the action attributes and act accordingly.
Returns a sorted list of actions for the menu filtered by what the user can access.
It returns a list of hashes containing two keys, group (the group name) and actions, a list of the actions for that group.
Provides a standard DateTime formatting function that is also mirrored (and called) from TT using the date_long() function.
Monday, 10 May 2010
Provides a short date format function for DD-MM-YYYY display.
Provides a long time format function, HH:MM:SS
Provides a short time format function, HH:MM
Adds the a breadcrumb on your breadcrumb trial. Pass it the context object and the breadcumb info,
$self->add_breadcrumb($c, { name => 'Title', url => $search_url });
Adds the final breadcrumb on your trial. Simply pass it the title of the breadcrumb.
$self->add_final_crumb($c, 'Title');
Flags an HTML::FormFu callback error.
Setup a callback constraint on your form,
- type: Text name: project label: Project constraints: - type: Callback message: Project is invalid
Then within your controller you can do,
$self->flag_callback_error($c, 'project');
This will terminate the processing of the action too, by doing a $c->detach;
L<CatalystX::AppBuilder>, L<OpusVL::AppKit>, L<Catalyst>
OpusVL - www.opusvl.com
This software is copyright (c) 2010 by OpusVL - www.opusvl.com.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install OpusVL::AppKit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpusVL::AppKit
CPAN shell
perl -MCPAN -e shell install OpusVL::AppKit
For more information on module installation, please visit the detailed CPAN module installation guide.