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.
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.
Returns to My Workspace without creating a new story.
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.
Save, Check-In story to a particular desk and redirects to that desk.
Checkout story and then call story editing interface.
The story editing interface.
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 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().
Creates a clone of the current story identified by the passed story_id and redirects to edit mode. The story is not saved.
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.
This mode saves the story to the database and leaves the story editor, sending control to workspace.pl.
This mode saves the story to the database and returns to edit.
This mode saves the current data to the session and previews the story in a new window.
This mode saves the current data to the session and jumps to editing an element within the story.
This mode saves the current data to the database and passes control to publisher.pl to publish the story.
This mode saves the current data to the session and passes control to view to view a version of the story.
This mode saves the current data to the session and passes control to view to view a version of the story.
This mode saves the current data to the session and passes control to edit schedule for story.
This mode saves the current data to the session and passes control to Krang::CGI::Contrib to edit contributors
This mode saves the current element data to the session and goes to the bulk edit mode.
Saves and changes the bulk edit separator, returning to edit.
This mode saves the current element data to the session and goes to the edit mode.
This mode saves the current element data to the session and jumps to edit the parent of this element.
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.
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.
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.
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.
Moves a story into the trash. Expects a story in the session.
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 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 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.
Trash all stories which were checked on the find screen.
Retire all stories which were checked on the find screen.
Check out to Workplace all the stories which were checked on the find screen.
Checkin all the stories which were checked on the list_active screen.
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.
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.
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.
Expects a story_id CGI param.
Returns a JSON header with checkout information about the story and the user asset permission for templates.
Wrapper around runmode checkout_and_edit, adding a JSON
header. Expects a story_id CGI param.