eTextReader.clientInterface
Interface NotationClient

All Known Implementing Classes:
DBClient

public interface NotationClient

An Interface between our browser and our notation server.

Version:
2.1, 11/12/2002
Author:
Marty Kane
See Also:
Criteria, Notation

Method Summary
 boolean closeConnection()
          Permanently close the connection to the database for this client.
 void deleteNotation(java.lang.String userName, java.lang.String theTable, Criteria selectCriteria)
          Delete an existing notation.
 void markAlerted(java.lang.String userName, Notation viewed)
          Mark the specified notation as read in the bigbrother logging table
 int postNotation(java.lang.String userName, java.lang.String theTable, Notation theNotation)
          Post a notation to a document.
 java.util.List<java.lang.String> requestFieldList(java.lang.String userName, java.lang.String theTable)
          Query the server for a list of valid Criteria fields.
 java.util.Vector requestGroupMembership(java.lang.String userName)
          Send a request to the server to retrieve the name and ID of all the groups to which a particular user belongs.
 java.util.Vector requestGroupNotationPreferences(java.lang.String userName)
          Get the group view preferences for the specified user's notations
 int requestNotationCount(java.lang.String userName, java.lang.String theTable, Criteria selectCriteria)
          Query the server for a count of the number of notations on a document.
 java.util.Vector requestNotationDownload(java.lang.String userName, java.lang.String theTable, Criteria selectCriteria, Criteria retrieveCriteria)
          Send a request to the server to download all notations that match the given criteria, retrieving only the fields indicated by retrieveCriteria.
 int requestNotationsEnabled(java.lang.String userName)
          Send a request to the server to retrieve the value of the enable notations column for the specified user
 java.util.Vector requestTargetNotations(java.lang.String userName, int all)
          Send a request to the server to download all notations targeted to the specified user using the GetTargetNotations stored procedure to adjust the list according to share and view preferences
 java.util.Vector requestUserList(java.lang.String courseID)
          Send a request to the server to retrieve a particular user's users and their associated userIDs
 java.util.Vector requestUserNotationPreferences(java.lang.String userName, java.lang.String course)
          Get the user view preferences for the specified user's notations
 java.util.Vector requestViewableNotations(java.lang.String url, java.lang.String userName)
          Send a request to the server to download all available notations for the specified user using the GetViewableNotations stored procedure to adjust the list according to share and view preferences
 Notation requestViewingPreferences(java.lang.String userName)
          Send a request to the server to retrieve the name of all the viewing prefernces based on the current available types
 int updateNotation(java.lang.String userName, java.lang.String theTable, Criteria selectCriteria, Notation theNotation)
          Update an existing notation.
 int updatePassword(java.lang.String userName, java.lang.String pwd)
          Update a user's password
 

Method Detail

requestFieldList

java.util.List<java.lang.String> requestFieldList(java.lang.String userName,
                                                  java.lang.String theTable)
Query the server for a list of valid Criteria fields.

Parameters:
userID - the ID of the person using the client.
theTable - the URL location of the server.

requestNotationCount

int requestNotationCount(java.lang.String userName,
                         java.lang.String theTable,
                         Criteria selectCriteria)
Query the server for a count of the number of notations on a document.

Parameters:
userID - the ID of the person using the client.
theTable - the table to retrieve Notations from
selectCriteria - the criteria used to select notations to count.
Returns:
The number of notations on the document which match the specified criteria.

requestViewableNotations

java.util.Vector requestViewableNotations(java.lang.String url,
                                          java.lang.String userName)
Send a request to the server to download all available notations for the specified user using the GetViewableNotations stored procedure to adjust the list according to share and view preferences

Parameters:
url - the url of the page for which the notations are desired
userName - the name of the user for which notations are retrieved

requestTargetNotations

java.util.Vector requestTargetNotations(java.lang.String userName,
                                        int all)
Send a request to the server to download all notations targeted to the specified user using the GetTargetNotations stored procedure to adjust the list according to share and view preferences

Parameters:
userName - the name of the user for which notations are retrieved
all - determines whether to retrieve all targeted notations (1) or just those that have not yet been viewed (0)

requestNotationDownload

java.util.Vector requestNotationDownload(java.lang.String userName,
                                         java.lang.String theTable,
                                         Criteria selectCriteria,
                                         Criteria retrieveCriteria)
Send a request to the server to download all notations that match the given criteria, retrieving only the fields indicated by retrieveCriteria.

Parameters:
userID - the ID of the person using the client.
theTable - the table to retrieve Notations from.
selectCriteria - the criteria used to select notations to count.
retrieveCriteria - the criteria used to specify which parts of the selected notations are downloaded.
Returns:
A Vector containing all the matching Notations.

requestNotationsEnabled

int requestNotationsEnabled(java.lang.String userName)
Send a request to the server to retrieve the value of the enable notations column for the specified user

Parameters:
userName - the name of the user
Returns:
An int containing the value of enableNotations

requestViewingPreferences

Notation requestViewingPreferences(java.lang.String userName)
Send a request to the server to retrieve the name of all the viewing prefernces based on the current available types

Parameters:
userName - the username for which the preferences are downloaded
Returns:
A notation object containing the types and settings

requestUserList

java.util.Vector requestUserList(java.lang.String courseID)
Send a request to the server to retrieve a particular user's users and their associated userIDs

Parameters:
courseID - the course to restrict user's to; if null, no restriction is made
Returns:
A Vector containing the usernames and IDs in notation objects

requestGroupMembership

java.util.Vector requestGroupMembership(java.lang.String userName)
Send a request to the server to retrieve the name and ID of all the groups to which a particular user belongs.

Parameters:
userName - the user name of the person using the client
Returns:
A Vector containing the group names and IDs in notation objects

requestGroupNotationPreferences

java.util.Vector requestGroupNotationPreferences(java.lang.String userName)
Get the group view preferences for the specified user's notations

Parameters:
userName - the user name for which the preferences will be retrieved
Returns:
A Vector containing the matching database entries

requestUserNotationPreferences

java.util.Vector requestUserNotationPreferences(java.lang.String userName,
                                                java.lang.String course)
Get the user view preferences for the specified user's notations

Parameters:
userName - the user name for which the preferences will be retrieved
course - the course ID for the current class
Returns:
A Vector containing the matching database entries

postNotation

int postNotation(java.lang.String userName,
                 java.lang.String theTable,
                 Notation theNotation)
Post a notation to a document.

Parameters:
userID - the ID of the person using the client.
theTable - the table to retrieve Notations from.
theNotation - the Notation to post, which will be assigned an ID by the server.
Returns:
the ID of the posted Notation. Note: if the object being posted is not a Notation (does not have an identity) the returned value is not valid.

markAlerted

void markAlerted(java.lang.String userName,
                 Notation viewed)
Mark the specified notation as read in the bigbrother logging table

Parameters:
userName - the name of the user
viewed - the notation object that we wish to mark as viewed

updatePassword

int updatePassword(java.lang.String userName,
                   java.lang.String pwd)
Update a user's password

Parameters:
userName - the name of the user
pwd - the value to which the password is changed
Returns:
an int indcating whether or not it was successful. A 0 indicates that an error was encountered, otherwise returns 1.

updateNotation

int updateNotation(java.lang.String userName,
                   java.lang.String theTable,
                   Criteria selectCriteria,
                   Notation theNotation)
Update an existing notation.

Parameters:
userID - the ID of the person using the client.
theTable - the table to retrieve Notations from.
selectCriteria - determines which notation is updated
theNotation - the new Notation object.
Returns:
the ID of the posted Notation.

deleteNotation

void deleteNotation(java.lang.String userName,
                    java.lang.String theTable,
                    Criteria selectCriteria)
Delete an existing notation.

Parameters:
userID - the ID of the person using the client.
theTable - the table to retrieve Notations from.
selectCriteria - determines which notation is updated

closeConnection

boolean closeConnection()
Permanently close the connection to the database for this client. To open a new connection, a new client object must be instantiated.