NAME
OpusVL::AppKit::RolesFor::Controller::GUI
VERSION
version 2.27
SYNOPSIS
package
MyApp::Controller::SomeFunkyThing;
use
Moose;
__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 ..
}
DESCRIPTION
You can just
do
:
Give your Controller a name within the GUI:
__PACKAGE__->config(
appkit_name
=>
'Some Name'
);
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
NAME
OpusVL::AppKit::RolesFor::Controller::GUI - Role
for
Controllers wanting to interact
with
AppKit
METHODS
home_action
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
.
navigation_actions
This should be an Array Ref of HashRef's pertaining the actions that make up the navigation
navigation_actions_grouped
This should be an Array Ref of HashRef's pertaining the actions that make up the navigation
grouped by appkit_method_group.
portlet_actions
This should be an Array Ref of HashRef
's pertaining the actions that are Portlet'
s
search_actions
This should be an Array Ref of HashRef
's pertaining the actions that are Portlet'
s
create_action
Hook into the creation of the actions.
Here we
read
the action attributes and act accordingly.
intranet_action_list
Returns a sorted list of actions for the menu filtered by what the user can access.
application_action_list
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.
date_long
Provides a standard DateTime formatting function that is also mirrored (and called) from TT using the date_long() function.
Monday, 10 May 2010
date_short
Provides a short date format function for DD-MM-YYYY display.
time_long
Provides a long time format function, HH:MM:SS
time_short
Provides a short time format function, HH:MM
add_breadcrumb
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
});
add_final_crumb
Adds the final breadcrumb on your trial. Simply pass it the title of the breadcrumb.
$self
->add_final_crumb(
$c
,
'Title'
);
flag_callback_error
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;
SEE ALSO
L<CatalystX::AppBuilder>,
L<OpusVL::AppKit>,
L<Catalyst>
AUTHOR
OpusVL - www.opusvl.com
COPYRIGHT AND LICENSE
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.