kotkabeans
Class NoticeBean

java.lang.Object
  |
  +--kotkabeans.NoticeBean

public class NoticeBean
extends java.lang.Object

This bean makes queries to database to show single person's messages and to add new messages into database.


Constructor Summary
NoticeBean()
          Dummy empty constructor.
NoticeBean(DB db, User user)
           
NoticeBean(User user)
           
 
Method Summary
 int countMessages(int personID)
          Exceute query to count the number of current messages for specified user.
 java.lang.String[] getReceivers(int noticeid)
          Exceute query to list all receivers of given message.
 void listPeopleToMultiselect(javax.servlet.jsp.JspWriter out, java.lang.String[] names, java.lang.String selectName)
          Exceute query to list all people's names according to given id's
 void listPeopleToMultiselect(javax.servlet.jsp.JspWriter out, User user, java.lang.String cond, int kolibriGroupID, int userGroupID, int departmentID, int courseID)
          Exceute query to list all people that match given condition
 void markAsDeleted(java.lang.String dels)
          Exceute query to mark some messages to be deleted.
 void markAsSaved(java.lang.String saves)
          Exceute query to mark some messages to be saved.
 void printKotkaCourse(javax.servlet.jsp.JspWriter out, java.lang.String selectName, int noChoiseValue, int selected)
          Exceute query to list all user groups in KOTKA system into a select box.
 void printKotkaDepartments(javax.servlet.jsp.JspWriter out, java.lang.String selectName, int noChoiseValue, int selected)
          Exceute query to list all departments in KOTKA system into a select box.
 void printKotkaUserGroups(javax.servlet.jsp.JspWriter out, java.lang.String selectName, int noChoiceValue, int selected)
          Exceute query to list all user groups in KOTKA system into a select box.
 void printKotkaUserGroups(javax.servlet.jsp.JspWriter out, java.lang.String selectName, int noChoiceValue, int selected, User user)
           
 void printMessages(javax.servlet.jsp.JspWriter out, int personID, boolean markAsRead)
          Exceute query to list given person's messages.
 int setNoticeBoardMsg(java.lang.String message, java.lang.String url, java.lang.String urlname)
          Exceute query to add new notice into tables noticeboard and noticeboardmsg.
 void writeToNoticeBoard(int writerID, int receiverID, int msgID, java.lang.String showUntil)
          Exceute query to add new notice into tables noticeboard and noticeboardmsg.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoticeBean

public NoticeBean()
Dummy empty constructor.


NoticeBean

public NoticeBean(User user)

NoticeBean

public NoticeBean(DB db,
                  User user)
Method Detail

setNoticeBoardMsg

public int setNoticeBoardMsg(java.lang.String message,
                             java.lang.String url,
                             java.lang.String urlname)
                      throws java.lang.Exception
Exceute query to add new notice into tables noticeboard and noticeboardmsg.

Parameters:
message - The body of the message.
url - The url related to the message.
java.lang.Exception

writeToNoticeBoard

public void writeToNoticeBoard(int writerID,
                               int receiverID,
                               int msgID,
                               java.lang.String showUntil)
                        throws java.lang.Exception
Exceute query to add new notice into tables noticeboard and noticeboardmsg.

Parameters:
writerID - The person who is about to add the message.
receiverID - The person to who the message is left.
msgID - The id of message to be added.
showUntil - The last date to show notice if the person hasn't read the message before that date.
java.lang.Exception

printMessages

public void printMessages(javax.servlet.jsp.JspWriter out,
                          int personID,
                          boolean markAsRead)
                   throws java.lang.Exception
Exceute query to list given person's messages.

Parameters:
out - The output stream
markAsRead - Mark the messages to be read
java.lang.Exception

countMessages

public int countMessages(int personID)
                  throws java.lang.Exception
Exceute query to count the number of current messages for specified user.

java.lang.Exception

markAsSaved

public void markAsSaved(java.lang.String saves)
                 throws java.lang.Exception
Exceute query to mark some messages to be saved.

Parameters:
saves - The id's of notices to be saved. String must be in format save1, save2, ... i.e. separated by comma.
java.lang.Exception

markAsDeleted

public void markAsDeleted(java.lang.String dels)
                   throws java.lang.Exception
Exceute query to mark some messages to be deleted.

java.lang.Exception

listPeopleToMultiselect

public void listPeopleToMultiselect(javax.servlet.jsp.JspWriter out,
                                    User user,
                                    java.lang.String cond,
                                    int kolibriGroupID,
                                    int userGroupID,
                                    int departmentID,
                                    int courseID)
                             throws java.lang.Exception
Exceute query to list all people that match given condition

Parameters:
out - The output stream
cond - The condition for lastname
java.lang.Exception

listPeopleToMultiselect

public void listPeopleToMultiselect(javax.servlet.jsp.JspWriter out,
                                    java.lang.String[] names,
                                    java.lang.String selectName)
                             throws java.lang.Exception
Exceute query to list all people's names according to given id's

Parameters:
out - The output stream
names - The array containing id's
selectName - The name for select box
java.lang.Exception

getReceivers

public java.lang.String[] getReceivers(int noticeid)
                                throws java.lang.Exception
Exceute query to list all receivers of given message.

Parameters:
noticeid - The id of the notice.
java.lang.Exception

printKotkaUserGroups

public void printKotkaUserGroups(javax.servlet.jsp.JspWriter out,
                                 java.lang.String selectName,
                                 int noChoiceValue,
                                 int selected)
                          throws java.lang.Exception
Exceute query to list all user groups in KOTKA system into a select box.

Parameters:
out - The output stream
java.lang.Exception

printKotkaUserGroups

public void printKotkaUserGroups(javax.servlet.jsp.JspWriter out,
                                 java.lang.String selectName,
                                 int noChoiceValue,
                                 int selected,
                                 User user)
                          throws java.lang.Exception
java.lang.Exception

printKotkaDepartments

public void printKotkaDepartments(javax.servlet.jsp.JspWriter out,
                                  java.lang.String selectName,
                                  int noChoiseValue,
                                  int selected)
                           throws java.lang.Exception
Exceute query to list all departments in KOTKA system into a select box.

Parameters:
out - The output stream
java.lang.Exception

printKotkaCourse

public void printKotkaCourse(javax.servlet.jsp.JspWriter out,
                             java.lang.String selectName,
                             int noChoiseValue,
                             int selected)
                      throws java.lang.Exception
Exceute query to list all user groups in KOTKA system into a select box.

Parameters:
out - The output stream
java.lang.Exception