OpenInteract2::Action::CommonDisplay - Task to display an object
# Just subclass and the task 'display' is implemented package OpenInteract2::Action::MyAction; use base qw( OpenInteract2::Action::CommonDisplay ); # Relevant configuration entries in your action.ini [myaction] ... c_object_type = myobject c_display_template = mypkg::detail c_display_fail_task = mypkg::display_error c_display_active_field = is_active
This common action supports the following tasks:
display - Display a non-editable object.
The 'display' task simply retrieves a specified object and sends it to a template. If the object checks its active status we first do that, but we do not really do too much.
c_display_template (no default)
This it the template we send the object to. The same object can be found in two keys: 'object' and whatever you have set c_object_type to. So a handler manipulating 'doodad' objects will find the specified doodad in 'object' and 'doodad'.
c_object_type
_display_customize( \%template_params )
Called just before we generate the content. You can add parameters to \%template_params so your template will see them.
\%template_params
These are in addition to the template parameters defined above.
c_object_type ($) (REQUIRED)
SPOPS key for object you will be displaying.
c_display_fail_task ($)
Task to run if we fail to fetch the object.
Default: 'common_error'
c_display_active_field ($)
c_display_active_field
If your object has a field indicating whether the object is active, specify it here. If specified we check the object for true values ('y', 'yes', '1', 'true') -- if none match, we pass control to the c_display_fail_task.
c_display_fail_task
c_task
Name of the task originally invoked: 'display'.
c_object_class ($)
SPOPS object class derived from c_object_type.
c_id_field ($)
c_id_field
ID field found from c_object_class.
c_object_class
c_id ($)
c_id
ID value used to fetch the object.
Copyright (c) 2002-2005 Chris Winters. All rights reserved.
Chris Winters <chris@cwinters.com>
To install OpenInteract2::URL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenInteract2::URL
CPAN shell
perl -MCPAN -e shell install OpenInteract2::URL
For more information on module installation, please visit the detailed CPAN module installation guide.