Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.sitemap.action
Class AddRemoveBookmarkAction  view AddRemoveBookmarkAction download AddRemoveBookmarkAction.java

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended bycom.RuntimeCollective.sitemap.action.AddRemoveBookmarkAction

public class AddRemoveBookmarkAction
extends org.apache.struts.action.Action

Bbookmarks or unbookmarks a SiteLocation, by adding it to / removing it from the logged-in user's bookmark list.

Version:
$Id: AddRemoveBookmarkAction.java,v 1.7 2003/09/30 15:12:58 joe Exp $

Field Summary
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
AddRemoveBookmarkAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward perform(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Bookmark a SiteLocation, by adding it to the logged-in user's bookmark list.
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddRemoveBookmarkAction

public AddRemoveBookmarkAction()
Method Detail

perform

public org.apache.struts.action.ActionForward perform(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.io.IOException,
                                                      javax.servlet.ServletException
Bookmark a SiteLocation, by adding it to the logged-in user's bookmark list. Gets the logged-in User from the session, under RuntimeParameters.get("logonUserKey"). Gets the bookmark list (a Bookmarks object) by calling Bookmarks.getBookmarksForUser(user);

Request parameters:

  • sm_add_bookmark_action - [Mandatory] Must be "add" or "remove". Specifies whether to add or remove the site location.
  • sm_add_bookmark_id - [Mandatory] The id of the SiteLocation entity bean to bookmark (integer).
  • sm_add_bookmark_forward - [Optional] The name of the Forward to return if the SiteLocation was successfully bookmarked. If this parameter is not specified, then this action will return the local "success" forward.
  • sm_add_bookmark_forward - [Optional] The name of the Forward to return if the SiteLocation cannot be bookmarked. If this parameter is not specified, then this action will return the local "failure" forward. In either case, an appropriate ActionError is generated.

Note all of these request parameters can be set using the AddBookmarkTag custom tag.

The following local Forwards are returned:

  • failure - if there was an error adding the bookmark (or the value of rs_bean_failForward if it is set.)
  • success - if the bookmark was added (or the value of rs_bean_forward if it is set.)

Error messages:

  • error.db.connection - if there was a problem connecting to the database.
  • error.bookmark.noSessionUser - if no User is on the session.
  • error.bookmark.ebs - if the EntityBeanStore couldn't get the SiteLocation
  • error.bookmark.add - had a problem adding the bookmark
  • error.bookmark.remove - had a problem removing the bookmark
  • error.bookmark.notAddOrRemove - if the specified sm_add_bookmark_action is not "add" or "remove"