Krang::CGI::Story - web interface to manage stories
use Krang::ClassLoader 'CGI::Story';
pkg('CGI::Story')->new()->run();
Following are descriptions of all the run-modes
provided by Krang::CGI::Story.
- new_story (default)
Allows the user to create a new story. Users choose the type, title,
slug, site/category and cover date on this screen. Requires no
parameters. Produces a form which is submitted to the create runmode.
- cancel_create
Returns to My Workspace without creating a new story.
- create
Creates a new story object and proceeds to edit_story. Expects the
form parameters from new_story. Upon error, returns to new_story with
an error message. Upon success, goes to edit_story.
- check_in_and_save
Save, Check-In story to a particular desk and redirects to that desk.
- checkout_and_edit
Checkout story and then call story editing interface.
- edit
The story editing interface.
- view
The story viewing interface. Requires a return_script parameter with
the name of the script to return to and a list of return_params
parameters containing key/value pairs for the return request.
Optionally, a story_id and a version may be passed. If a story_id is
not present then a story must be available in the session.
- revert
Revert contents of a story to that of an older version. Expects a
story in the session and 'version' parameter. Returns to edit mode
after $story->revert().
- copy
Creates a clone of the current story identified by the passed story_id
and redirects to edit mode. The story is not saved.
- replace_dupes
This mode gathers a list of stories whose URLs duplicate the current story's
and either removes them from the conflicting locations, or - if all their
locations conflict - deletes them entirely.
- db_save
This mode saves the story to the database and leaves the story editor,
sending control to workspace.pl.
- db_save_and_stay
This mode saves the story to the database and returns to edit.
- preview_and_stay
This mode saves the current data to the session and previews the
story in a new window.
- save_and_jump
This mode saves the current data to the session and jumps to editing
an element within the story.
- save_and_publish
This mode saves the current data to the database and passes control to
publisher.pl to publish the story.
- save_and_view
This mode saves the current data to the session and passes control to
view to view a version of the story.
- save_and_view_log
This mode saves the current data to the session and passes control to
view to view a version of the story.
- save_and_edit_schedule
This mode saves the current data to the session and passes control to
edit schedule for story.
- save_and_edit_contribs
This mode saves the current data to the session and passes control to
Krang::CGI::Contrib to edit contributors
- save_and_bulk_edit
This mode saves the current element data to the session and goes to
the bulk edit mode.
- save_and_change_bulk_edit_sep
Saves and changes the bulk edit separator, returning to edit.
- save_and_leave_bulk_edit
This mode saves the current element data to the session and goes to
the edit mode.
- save_and_go_up
This mode saves the current element data to the session and jumps to
edit the parent of this element.
- add_category
Adds a category to the story. Expects a category ID in
add_category_id, which is filled in by the category chooser on the
edit screen. Returns to edit mode on success and on failure with an
error message.
- set_primary_category
Sets the primary category for the story. Expects a category ID in
primary_category_id, which is filled in by the primary radio group in
the edit screen. Returns to edit mode on success and on failure with
an error message.
- replace_category
Replaces one category with another. Expects one category ID in
category_to_replace_id, and another in category_replacement_id.
Returns to edit mode on success and on failure with an error message.
- delete_categories
Removes categories from the story. Expects one or more cat_remove_$id
variables set with checkboxes. Returns to edit mode on success and on
failure with an error message.
- delete
Moves a story into the trash. Expects a story in the session.
- find
List live stories which match the search criteria. Provide buttons to
view, edit, copy and retire each story (depending on the user's story
asset permissions).
Also, provide checkboxes next to each story through which the user may
select a set of stories to be checked out to Workplace, published or
deleted (also depending on the user's permissions).
- list_retired
List live stories which match the search criteria. Provide buttons to
view, copy and unretire each story (depending on the user's story
asset permissions).
Also, provide checkboxes next to each story through which the user may
select a set of stories to be deleted (also depending on the user's
permissions).
- list_active
List all active stories. Provide links to view each story. If the
user has 'checkin all' admin abilities then checkboxes are provided to
allow the stories to be stolen or checked-in.
- delete_selected
Trash all stories which were checked on the find screen.
- checkout_selected
Check out to Workplace all the stories which were checked on the find screen.
- checkin_selected
Checkin all the stories which were checked on the list_active screen.
- steal_selected
Steal all the stories which were checked on the list_active screen,
and either go to workspace of user, or - if only one story was checked -
directly to the edit screen.
- retire
Usage: Runmode.
Purpose: Move story to the retire and return to the Find Story screen.
Parameters: Requires a story ID in CGI param 'story_id'.
Throws: None.
Croaks: If the story can't be loaded from the database.
Returns: Find Story screen.
- unretire
Usage: Runmode.
Purpose: Move story from retire back to live.
Parameters: Requires a story ID in CGI param 'story_id'.
Throws: None.
Croaks: If the story can't be loaded from the database.
Returns: See Comments.
Comments: Modify the story's slug or clear its categories if it
url-conflicts with a live story or category. If a URL
conflict occures, return to Edit Story, otherwise return
to Retired Stories.