BEA Systems, Inc.

examples.portlet.bean
Class BookmarkBean

java.lang.Object
  |
  +--examples.portlet.bean.BookmarkBean

public class BookmarkBean
extends java.lang.Object
implements java.io.Serializable, ToolkitConstants

JSP Bean for the bookmark_edit.jsp for the example Bookmark portlet.

See Also:
Serialized Form

Field Summary
static java.lang.String CHECK
          Constant for the SQL Select String that checks to see if there are bookmarks for a user.
static java.lang.String DELETE
          Constant for the SQL delete String that deletes a bookmark for a user.
static java.lang.String INSERT
          Constant for the SQL Insert String that inserts a bookmark for a user.
static int MODE_DELETE
          Mode constant for delete mode.
static int MODE_INSERT
          Mode constant for insert mode.
static java.lang.String QUERY
          Constant for the SQL Query String that finds all the bookmarks for a user.
 
Fields inherited from interface com.beasys.commerce.axiom.util.ToolkitConstants
DEFAULT_ID_CACHE, DEFAULT_ID_PROCEDURE, DEFAULT_JDBC_POOL_NAME, DEFAULT_JTS_POOL_NAME, DEFAULT_LOGGING_LEVEL, DEFAULT_WEBLOGIC_HOST, DEFAULT_WEBLOGIC_PORT, ID_CACHE, ID_PROCEDURE, JDBC_POOL_NAME, JTS_POOL_NAME, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_SECURITY, LOG_WARNING, LOGGING_LEVEL, WEBLOGIC_HOST, WEBLOGIC_PORT
 
Constructor Summary
BookmarkBean()
          Creates a new instance.
 
Method Summary
 java.lang.String[][] asTable()
          Returns a 2 dimensional array (table) of the user's current bookmarks.
 void createQuery(java.sql.PreparedStatement ps, java.lang.String anId)
          A helper method to create the bookmark query string.
 void fillCheck(java.sql.PreparedStatement ps, java.lang.String anId)
          A helper method to fill the CHECK SQL statement.
 void fillDelete(java.sql.PreparedStatement ps, java.lang.String anId)
          A helper method to fill the DELETE SQL statement.
 void fillInsert(java.sql.PreparedStatement ps, java.lang.String anId)
          A helper method to fill the INSERT SQL statement.
 java.lang.String getBookmarkName()
          Gets the bookmark name attribute
 java.lang.String getBookmarkURL()
          Gets the bookmark URL attribute
 int getMode()
          Returns the mode for this request.
 void load(java.sql.ResultSet rs)
          Loads the bookmark items into the items list with the results of a query.
 void setBookmarkInsertButton(java.lang.String ignore)
          Sets the mode to INSERT
 void setBookmarkName(java.lang.String aName)
          Sets the bookmark name attribute for the current request
 void setBookmarkToDelete(java.lang.String aBookmark)
          Sets the bookmark name to delete for the current request
 void setBookmarkURL(java.lang.String aURL)
          Sets the bookmark URL attribute for the current request
 void setMode(int aMode)
          Sets the mode for a request.
 java.lang.String validateInsert()
          Validates an insert request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_INSERT

public static final int MODE_INSERT
Mode constant for insert mode.

MODE_DELETE

public static final int MODE_DELETE
Mode constant for delete mode.

QUERY

public static final java.lang.String QUERY
Constant for the SQL Query String that finds all the bookmarks for a user.

INSERT

public static final java.lang.String INSERT
Constant for the SQL Insert String that inserts a bookmark for a user.

CHECK

public static final java.lang.String CHECK
Constant for the SQL Select String that checks to see if there are bookmarks for a user.

DELETE

public static final java.lang.String DELETE
Constant for the SQL delete String that deletes a bookmark for a user.
Constructor Detail

BookmarkBean

public BookmarkBean()
Creates a new instance.
Method Detail

getMode

public int getMode()
Returns the mode for this request.
Returns:
int - one of the mode constants

setMode

public void setMode(int aMode)
Sets the mode for a request.
Parameters:
aMode - One of the mode constants.

setBookmarkName

public void setBookmarkName(java.lang.String aName)
Sets the bookmark name attribute for the current request
Parameters:
aName - The bookmark name.

getBookmarkName

public java.lang.String getBookmarkName()
Gets the bookmark name attribute
Returns:
String - The bookmark name for the current request.

setBookmarkURL

public void setBookmarkURL(java.lang.String aURL)
Sets the bookmark URL attribute for the current request
Parameters:
aName - The bookmark URL.

getBookmarkURL

public java.lang.String getBookmarkURL()
Gets the bookmark URL attribute
Returns:
String - The bookmark URL for the current request.

setBookmarkToDelete

public void setBookmarkToDelete(java.lang.String aBookmark)
Sets the bookmark name to delete for the current request
Parameters:
aBookmark - The bookmark name to delete.

asTable

public java.lang.String[][] asTable()
Returns a 2 dimensional array (table) of the user's current bookmarks.
Returns:
String[][] - A 2 dimensional array (table) of the user's current bookmarks.

createQuery

public void createQuery(java.sql.PreparedStatement ps,
                        java.lang.String anId)
                 throws java.sql.SQLException
A helper method to create the bookmark query string.
Parameters:
ps - The prepared statement for the query.
anId - The owner's (user's) id
Throws:
java.sql.SQLException - Is thrown if an error occurs.

fillInsert

public void fillInsert(java.sql.PreparedStatement ps,
                       java.lang.String anId)
                throws java.sql.SQLException
A helper method to fill the INSERT SQL statement.
Parameters:
ps - The prepared statement for the query.
anId - The owner's (user's) id.
Throws:
java.sql.SQLException - Is thrown if an error occurs.

fillCheck

public void fillCheck(java.sql.PreparedStatement ps,
                      java.lang.String anId)
               throws java.sql.SQLException
A helper method to fill the CHECK SQL statement.
Parameters:
ps - The prepared statement for the query.
anId - The owner's (user's) id.
Throws:
java.sql.SQLException - Is thrown if an error occurs.

fillDelete

public void fillDelete(java.sql.PreparedStatement ps,
                       java.lang.String anId)
                throws java.sql.SQLException
A helper method to fill the DELETE SQL statement.
Parameters:
ps - The prepared statement for the query.
anId - The owner's (user's) id.
Throws:
java.sql.SQLException - Is thrown if an error occurs.

load

public void load(java.sql.ResultSet rs)
Loads the bookmark items into the items list with the results of a query.
Parameters:
rs - The query result set.

setBookmarkInsertButton

public void setBookmarkInsertButton(java.lang.String ignore)
Sets the mode to INSERT
Parameters:
ignore - This parameter is ignored.

validateInsert

public java.lang.String validateInsert()
Validates an insert request.
Returns:
String - null if no error, else it returns an error string.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved