Krang::CGI::Template - Module what manages templates
use Krang::ClassLoader 'CGI::Template';
my $app = pkg('CGI::Template')->new();
$app->run();
This module provide the end-user interface to template objects. Here, users
may search for, view, edit, and create templates.
- add
This screen allows the end-user to add a new Template object.
- add_checkin
Saves changes to the template object the end-user enacted on the 'Add'
screen, then checks in.
The user is sent to 'My Workspace' if save succeeds and back to the 'Add'
screen if it fails.
- add_save
Saves changes to the template object the end-user enacted on the 'Add' screen.
The user is sent to 'My Workspace' if save succeeds and back to the 'Add'
screen if it fails.
- add_save_stay
Validates changes to the template from the 'Add' screen, saves the updated
object to the database, and redirects to the 'Edit' screen.
- checkin_selected
Checkin all the templates which were checked on the list_active screen.
- checkout_and_edit
Checks out the template object identified by template_id and sends the user
to edit.
- delete
Trashes a template object from the 'Edit' screen. The user is sent back to the
'search' mode afterwards.
The mode expects the query parameter 'template_id'.
- delete_selected
Trashes template objects selected from the 'search' screen and returns to
'search'. If the object associated with a particular template_id cannot be
trashed, the user is returned to 'search' screen with an error message.
This mode expects the 'krang_pager_rows_checked' query param to contain the ids
of the objects to be deleted. If none are passed, the user is returned to
the 'search' screen.
- deploy
Saves, deploys and checks in template. Redirects to My Workspace.
- deploy_selected
Deploys selected templates from the find interface.
- edit
Displays the properties of a template object and allows the user to modify the
writable fields of the object.
This runmode expects the query parameter 'template_id'.
- edit_checkin
Saves changes to the template object the end-user enacted on the 'Edit' screen,
then checks in. The user is sent to 'My Workspace' if save succeeds and back
to the 'Edit' screen if it fails.
- edit_save
Saves changes to the template object the end-user enacted on the 'Edit' screen.
The user is sent to 'My Workspace' if save succeeds and back to the 'Edit'
screen if it fails.
- edit_save_stay
Validates changes to the template from the 'Edit' screen, saves the updated
object to the database, and redirects to the 'Edit' screen.
- revert_version
Reverts the template to a prior incarnation then redirects to the 'Edit'
screen.
- save_and_view_log
The purpose of this mode is to hand the user off to the log viewng
screen. This mode writes changes back to the template object without
calling save(). When done, it performs an HTTP redirect to
history.pl.
- view_log
The purpose of this mode is to hand the user off to the log viewng
screen to view the template in question.
- search
Displays a list of live Template objects based on the passed search criteria. If no
criteria are passed, a list of all templates on the system are returned. As a
simple search, the 'element', 'site', and 'url' fields are searched.
The run mode accepts the parameter ``search_filter'' which is used to perform
simple searches.
From this paging view the user may choose to view, edit or retire an
object, or select a set of objects to be deployed or deleted
(depending on the user's permission set).
- list_retired
Displays a list of retired Template objects based on the passed
search criteria. If no criteria are passed, a list of all templates
on the system are returned. As a simple search, the 'element',
'site', and 'url' fields are searched.
The run mode accepts the parameter ``search_filter'' which is used to perform
simple searches.
From this paging view the user may choose to view or unretire an
object, or select a set of objects to be deleted (depending on the
user's permission set).
- view
View the attributes of the template object.
- view_version
Display the specified version of the template object in a view form.
- list_active
List all active templates. Provide links to view each template. If the
user has 'checkin all' admin abilities then checkboxes are provided to
allow the template to be checked-in.
- retire
Move template to the retire and return to the Find Template screen
- unretire
Move template from retire back to live. If a DuplicateURL conflict
occurs, leave the template retired and alert the user.