Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardAttachment.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/Attic/NoticeboardAttachment.java,v diff -u -r1.6 -r1.7 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardAttachment.java 5 Aug 2005 05:03:57 -0000 1.6 +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardAttachment.java 10 Aug 2005 06:49:31 -0000 1.7 @@ -21,9 +21,6 @@ /* * Created on Jul 28, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates */ package org.lamsfoundation.lams.tool.noticeboard; @@ -32,20 +29,36 @@ /** + *
This class represents a file that is uploaded to the noticeboard tool. + * It is used in the authoring environment, when an author + * uploads an online/offline instructions file. The file is actually stored + * in the content repository, however, the file details will be stored in the + * tl_lanb11_attachment table. The file uploaded, will be of two types: online or offline. + *
+ * * @author mtruong - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates */ public class NoticeboardAttachment implements Serializable { + /** identifier field */ private Long attachmentId; + + /** persistent field. Cannot be null */ private NoticeboardContent nbContent; + + /** persistent field. Cannot be null */ private String filename; + + /** unique persistent field. Cannot be null */ private Long uuid; + + /** nullable persistent field */ private Long versionId; + + /** persistent field. Cannot be null. It can either take values "ONLINE" or "OFFLINE" */ private boolean onlineFile; + /** The two different types of files/attachment that can be uploaded */ public final static String TYPE_ONLINE = "ONLINE"; public final static String TYPE_OFFLINE = "OFFLINE"; @@ -79,11 +92,6 @@ /** - * @hibernate.id - * generator-class="native" - * type="java.lang.Long" - * column="attachment_id" - * * @return Returns the attachmentId. */ public Long getAttachmentId() { @@ -98,11 +106,6 @@ } /** - * @hibernate.property - * column="filename" - * length="255" - * not-null="true" - * * @return Returns the filename. */ public String getFilename() { @@ -116,11 +119,6 @@ } /** - * @hibernate.property - * column="online_file" - * length="1" - * not-null="true" - * * @return Returns the isOnline. */ public boolean isOnlineFile() { @@ -134,10 +132,6 @@ } /** - * @hibernate.many-to-one - * not-null="true" - * @hibernate.column name="nb_content_uid" - * * @return Returns the nbContent. */ public NoticeboardContent getNbContent() { @@ -151,11 +145,6 @@ } /** - * @hibernate.property - * column="uuid" - * length="20" - * not-null="true" - * * @return Returns the uuid. */ public Long getUuid() { @@ -169,13 +158,9 @@ } /** - * @hibernate.property - * column="version_id" - * length="20" - * * @return Returns the versionId. */ - public Long getVersionId() { + public Long getVersionId() { //nullable return versionId; } /** Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardContent.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardContent.java,v diff -u -r1.7 -r1.8 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardContent.java 29 Jul 2005 04:24:55 -0000 1.7 +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardContent.java 10 Aug 2005 06:49:31 -0000 1.8 @@ -26,12 +26,11 @@ import java.util.HashSet; -import org.apache.commons.lang.builder.EqualsBuilder; /** - * Persistent noticeboard object/bean that defines the content for the noticeboard tool. - * Provides accessors and mutators to get/set noticeboard attributes + *Persistent noticeboard object/bean that defines the content for the noticeboard tool. + * Provides accessors and mutators to get/set noticeboard attributes
+ * * @author mtruong - * */ public class NoticeboardContent implements Serializable { Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardSession.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardSession.java,v diff -u -r1.5 -r1.6 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardSession.java 14 Jul 2005 02:17:33 -0000 1.5 +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardSession.java 10 Aug 2005 06:49:31 -0000 1.6 @@ -27,8 +27,17 @@ import java.util.Set; /** + *The NoticeboardSession class represents a tool session for a noticeboard activity. + * Each tool session may represent a group of users, if grouping is used, or may + * represent one learner if there is no grouping for this particular activity. + *
+ *The session status has three possible status': + *
The NoticeboardUser class represents the learners that will participate + * the noticeboard activity. Each learner will have a tool session id which represents + * which group they belong to, or there is no grouping, then each learner will have their own + * tool session id.
+ *The userStatus can be of two values + *
Handles database access for uploading, updates and removal of files.
*/ public interface INoticeboardAttachmentDAO { + /** + * Return the persistent instance of NoticeboardAttachment with the given + * identifierattachmentId
+ *
+ * @param attachmentId The unique identifier for attachment. If null, a null object will be returned.
+ * @return an instance of NoticeboardAttachment
+ */
public NoticeboardAttachment retrieveAttachment(Long attachmentId);
+ /**
+ * Return the persistent instance of NoticeboardAttachment with the given
+ * unique identifier uuid
.
+ *
+ * @param uuid The uuid of the file, which is also the uuid of the file which is stored in the content repository.
+ * @return an instance of NoticeboardAttachment
+ */
public NoticeboardAttachment retrieveAttachmentByUuid(Long uuid);
+ /**
+ * Return the persistent instance of NoticeboardAttachment with the given
+ * filename
. If there is more than one file with the same filename
+ * then only the first file in the list will be returned.
+ *
+ * @param filename The name of the file
+ * @return an instance of NoticeboardAttachment
+ */
public NoticeboardAttachment retrieveAttachmentByFilename(String filename);
+ /**
+ * Returns a list of attachment ids which are associated with this
+ * instance of NoticeboardContent.
+ * For example, if the given instance nbContent
has a tool content id
+ * of 3, and consider an extract of the tl_lanb11_attachment table:
+ * ---------------------------- + * attachmentId | toolContentId + * ---------------------------- + * 1 | 1 + * 2 | 3 + * 3 | 3 + * 4 | 1 + * ---------------------------- + *+ * Then a call to
getAttachmentIdsFromContent
will return a list containing the values
+ * 2 and 3.
+ * @param nbContent
+ * @return
+ */
public List getAttachmentIdsFromContent(NoticeboardContent nbContent);
+ /**
+ * Persist the given persistent instance of NoticeboardAttachment.
+ * + * @param attachment The instance of NoticeboardAttachment to persist. + */ public void saveAttachment(NoticeboardAttachment attachment); + /** + *Delete the given persistent instance of NoticeboardAttachment.
+ * + * @param attachment The instance of NoticeboardAttachment to delete. + */ public void removeAttachment(NoticeboardAttachment attachment); + /** + *Delete the given instance of NoticeboardAttachment with the
+ * given uuid
+ *
+ * @param uuid The unique id of the file/attachment.
+ */
public void removeAttachment(Long uuid);
}
Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/INoticeboardContentDAO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/INoticeboardContentDAO.java,v
diff -u -r1.3 -r1.4
--- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/INoticeboardContentDAO.java 14 Jul 2005 02:19:43 -0000 1.3
+++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/INoticeboardContentDAO.java 10 Aug 2005 06:50:30 -0000 1.4
@@ -24,28 +24,87 @@
import org.lamsfoundation.lams.tool.noticeboard.NoticeboardSession;
/**
- * Interface for the NoticeboardContent DAO, defines methods needed to access/modify
- * noticeboard content
+ *
Interface for the NoticeboardContent DAO, defines methods needed to access/modify + * noticeboard content
* @author mtruong */ public interface INoticeboardContentDAO { - + + + /** + *Return the persistent instance of a NoticeboardContent
+ * with the given identifier uid
, returns null if not found.
Return the persistent instance of a NoticeboardContent
+ * with the given tool content id nbContentId
,
+ * returns null if not found.
Returns the persistent instance of NoticeboardContent
+ * with the given tool session id nbSessionId
, returns null if not found.
+ *
+ * @param nbSessionId The tool session id
+ * @return a persistent instance of NoticeboardContent or null if not found.
+ */
public NoticeboardContent getNbContentBySession(Long nbSessionId);
+ /**
+ *
Persist the given persistent instance of NoticeboardContent.
+ * + * @param nbContent The instance of NoticeboardContent to persist. + */ public void saveNbContent(NoticeboardContent nbContent); + /** + *Update the given persistent instance of NoticeboardContent.
+ * + * @param nbContent The instance of NoticeboardContent to persist. + */ public void updateNbContent(NoticeboardContent nbContent); + /** + *Delete the given instance of NoticeboardContent
+ * + * @param nbContent The instance of NoticeboardContent to delete. + */ public void removeNoticeboard(NoticeboardContent nbContent); + /** + *Delete the given instance of NoticeboardContent with the
+ * given tool content id nbContentId
+ *
+ * @param nbContentId The tool content Id.
+ */
public void removeNoticeboard(Long nbContentId);
+
+ /**
+ *
Deletes all instances of NoticeboardSession that are associated + * with the given instance of NoticeboardContent
+ * + * @param nbContent The instance of NoticeboardContent in which corresponding instances of NoticeboardSession should be deleted. + */ public void removeNbSessions(NoticeboardContent nbContent); + /** + *Creates a persistent instance of NoticeboardSession which is associated
+ * with the NoticeboardContent with tool content id nbContentId
+ *
Interface for the NoticeboardSession DAO, defines methods needed to access/modify + * noticeboard session
* @author mtruong */ public interface INoticeboardSessionDAO { - public NoticeboardSession findNbSessionById(Long nbSessionId); + + /** + * Return the persistent instance of a NoticeboardSession
+ * with the given tool session id nbSessionId
,
+ * returns null if not found.
Return the persistent instance of a NoticeboardSession
+ * with the given identifier uid
, returns null if not found.
Persist the given persistent instance of NoticeboardSession.
+ * + * @param nbSession The instance of NoticeboardSession to persist. + */ + public void saveNbSession(NoticeboardSession nbSession); + /** + *Update the given persistent instance of NoticeboardSession.
+ * + * @param nbContent The instance of NoticeboardSession to persist. + */ public void updateNbSession(NoticeboardSession nbSession); + /** + *Delete the given instance of NoticeboardSession with the
+ * given identifier uid
+ *
+ * @param uid an identifier for the NoticeboardSession instance.
+ */
public void removeNbSessionByUID(Long uid);
+ /**
+ *
Delete the given instance of NoticeboardSession
+ * + * @param nbSession The instance of NoticeboardSession to delete. + */ public void removeNbSession(NoticeboardSession nbSession); + /** + *Delete the given instance of NoticeboardSession with the
+ * given tool session id nbSessionid
+ *
+ * @param nbSessionId The tool session Id.
+ */
public void removeNbSession(Long nbSessionId);
- public NoticeboardSession getNbSessionByUser(Long userId); /** TODO: write testcase and def for getNbSessionByUser */
+ /**
+ *
Returns the persistent instance of NoticeboardSession
+ * associated with the given noticeboard user, with user id userId
,
+ * returns null if not found.
+ *
+ * @param userId The noticeboard user id
+ * @return a persistent instance of NoticeboardSessions or null if not found.
+ */
+ public NoticeboardSession getNbSessionByUser(Long userId);
- public void removeNbUsers(NoticeboardSession nbSession); /** TODO: write testcase and def for removeNbUsers */
+ /**
+ *
Deletes all instances of NoticeboardUser that are associated + * with the given instance of NoticeboardSession
+ * + * @param nbSession The instance of NoticeboardSession in which corresponding instances of NoticeboardUser should be deleted. + */ + public void removeNbUsers(NoticeboardSession nbSession); + /** + *Creates and persists an instance of NoticeboardUser which is associated
+ * with the NoticeboardSession with tool session id nbSessionId
For example, if the given instance nbContent
has a tool content id
+ * of 3, and consider an extract of the tl_lanb11_session table:
+ * ---------------------------- + * attachmentId | toolSessionId + * ---------------------------- + * 1 | 3 + * 2 | 3 + * 3 | 3 + * 4 | 1 + * ---------------------------- + *+ * Then a call to
getSessionsFromContent
will return a list containing the values
+ * 1, 2 and 3.
+ * @param nbContent The instance of NoticeboardContent in which you want the list of toolSessionIds
+ * @return a list of tool session Ids
+ */
public List getSessionsFromContent(NoticeboardContent nbContent);
}
\ No newline at end of file
Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/INoticeboardUserDAO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/INoticeboardUserDAO.java,v
diff -u -r1.2 -r1.3
--- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/INoticeboardUserDAO.java 21 Jul 2005 04:34:30 -0000 1.2
+++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/INoticeboardUserDAO.java 10 Aug 2005 06:50:30 -0000 1.3
@@ -30,21 +30,67 @@
/**
* @author mtruong
+ *
+ * Interface for the NoticeboardSession DAO, defines methods needed to access/modify + * noticeboard users (learners of the noticeboard activity)
*/ public interface INoticeboardUserDAO { + /** + *Return the persistent instance of a NoticeboardUser
+ * with the given identifier uid
, returns null if not found.
Return the persistent instance of a NoticeboardUser
+ * with the given user id userId
,
+ * returns null if not found.
Persist the given persistent instance of NoticeboardUser.
+ * + * @param nbUser The instance of NoticeboardUser to persist. + */ public void saveNbUser(NoticeboardUser nbUser); + /** + *Update the given persistent instance of NoticeboardUser.
+ * + * @param nbUser The instance of NoticeboardUser to persist. + */ public void updateNbUser(NoticeboardUser nbUser); + /** + *Delete the given instance of NoticeboardUser
+ * + * @param nbUser The instance of NoticeboardUser to delete. + */ public void removeNbUser(NoticeboardUser nbUser); + /** + *Delete the given instance of NoticeboardUser with the
+ * given user id userId
+ *
+ * @param userId The noticeboard user id.
+ */
public void removeNbUser(Long userId);
+ /**
+ * Returns the number of users that are in this particular
+ * session.
+ *
+ * @param nbSession
+ * @return the number of users that are in this session
+ */
public int getNumberOfUsers(NoticeboardSession nbSession);
}
Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/hibernate/NoticeboardAttachmentDAO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/hibernate/Attic/NoticeboardAttachmentDAO.java,v
diff -u -r1.3 -r1.4
--- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/hibernate/NoticeboardAttachmentDAO.java 3 Aug 2005 02:31:37 -0000 1.3
+++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/hibernate/NoticeboardAttachmentDAO.java 10 Aug 2005 06:50:39 -0000 1.4
@@ -1,8 +1,6 @@
/*
* Created on Jul 29, 2005
*
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
*/
package org.lamsfoundation.lams.tool.noticeboard.dao.hibernate;
@@ -15,18 +13,21 @@
/**
* @author mtruong
*
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
+ *
Hibernate implementation for database access of noticeboard attachment, + * which are generally the uploads, updates and removal of online/offline + * instruction files
*/ public class NoticeboardAttachmentDAO extends HibernateDaoSupport implements INoticeboardAttachmentDAO { private static final String GET_ATTACHMENT_FROM_CONTENT = "select na.attachmentId from NoticeboardAttachment na where na.nbContent= :nbContent"; + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardAttachmentDAO#retrieveAttachment(java.lang.Long) */ public NoticeboardAttachment retrieveAttachment(Long attachmentId) { return (NoticeboardAttachment)this.getHibernateTemplate().get(NoticeboardAttachment.class, attachmentId); } + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardAttachmentDAO#retrieveAttachmentByUuid(java.lang.Long) */ public NoticeboardAttachment retrieveAttachmentByUuid(Long uuid) { String query = "from NoticeboardAttachment na where na.uuid=?"; @@ -41,6 +42,7 @@ } } + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardAttachmentDAO#retrieveAttachmentByFilename(java.lang.String) */ public NoticeboardAttachment retrieveAttachmentByFilename(String filename) { String query= "from NoticeboardAttachment na where na.filename=?"; @@ -56,24 +58,27 @@ } - /* get the list of attachment ids which have the toolcontentid equals to that of nbCotnetn.getNbContentId */ + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardAttachmentDAO#getAttachmentIdsFromContent(org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent) */ public List getAttachmentIdsFromContent(NoticeboardContent nbContent) { return (getHibernateTemplate().findByNamedParam(GET_ATTACHMENT_FROM_CONTENT, "nbContent", nbContent)); } + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardAttachmentDAO#saveAttachment(org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent) */ public void saveAttachment(NoticeboardAttachment attachment) { this.getHibernateTemplate().saveOrUpdate(attachment); } + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardAttachmentDAO#removeAttachment(org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent) */ public void removeAttachment(NoticeboardAttachment attachment) { this.getHibernateTemplate().delete(attachment); } + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardAttachmentDAO#removeAttachment(java.lang.Long) */ public void removeAttachment(Long uuid) { this.getHibernateTemplate().delete(retrieveAttachmentByUuid(uuid)); Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/hibernate/NoticeboardContentDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/hibernate/NoticeboardContentDAO.java,v diff -u -r1.3 -r1.4 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/hibernate/NoticeboardContentDAO.java 14 Jul 2005 02:20:09 -0000 1.3 +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dao/hibernate/NoticeboardContentDAO.java 10 Aug 2005 06:50:39 -0000 1.4 @@ -34,7 +34,7 @@ /** * @author mtruong - * Hibernate implementation for database access to Noticeboard content for the noticeboard tool. + *Hibernate implementation for database access to Noticeboard content for the noticeboard tool.
*/ public class NoticeboardContentDAO extends HibernateDaoSupport implements INoticeboardContentDAO { @@ -45,27 +45,14 @@ - /** - *Return the persistent instance of a NoticeboardContent
- * with the given identifier uid
, returns null if not found.
Return the persistent instance of a NoticeboardContent
- * with the given tool content id nbContentId
,
- * returns null if not found.
Returns the persistent instance of NoticeboardContent
- * with the given tool session id nbSessionId
, returns null if not found.
- *
- * @param nbSessionId The tool session id
- * @return a persistent instance of NoticeboardContent or null if not found.
- */
+
+ /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardContentDAO#getNbContentBySession(java.lang.Long) */
public NoticeboardContent getNbContentBySession(final Long nbSessionId)
{
return (NoticeboardContent) getHibernateTemplate().execute(new HibernateCallback()
@@ -103,33 +85,22 @@
});
}
- /**
- *
Persist the given persistent instance of NoticeboardContent.
- * - * @param nbContent The instance of NoticeboardContent to persist. - */ - public void saveNbContent(NoticeboardContent nbContent) + + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardContentDAO#saveNbContent(org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent) */ + public void saveNbContent(NoticeboardContent nbContent) { this.getHibernateTemplate().save(nbContent); } - /** - *Update the given persistent instance of NoticeboardContent.
- * - * @param nbContent The instance of NoticeboardContent to persist. - */ - public void updateNbContent(NoticeboardContent nbContent) + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardContentDAO#updateNbContent(org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent) */ + public void updateNbContent(NoticeboardContent nbContent) { this.getHibernateTemplate().update(nbContent); } - /** - *Delete the given instance of NoticeboardContent with the
- * given tool content id nbContentId
- *
- * @param nbContentId The tool content Id.
- */
- public void removeNoticeboard(Long nbContentId)
+
+ /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardContentDAO#removeNoticeboard(java.lang.Long)*/
+ public void removeNoticeboard(Long nbContentId)
{
String query = "from NoticeboardContent as nb where nb.nbContentId=";
@@ -140,35 +111,19 @@
this.getHibernateTemplate().delete(queryString);
}
- /**
- *
Delete the given instance of NoticeboardContent
- * - * @param nbContent The instance of NoticeboardContent to delete. - */ + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardContentDAO#removeNoticeboard(org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent)*/ public void removeNoticeboard(NoticeboardContent nbContent) { this.getHibernateTemplate().delete(nbContent); } - - /** - *Deletes all instances of NoticeboardSession that are associated - * with the given instance of NoticeboardContent
- * - * @param nbContent The instance of NoticeboardContent in which corresponding instances of NoticeboardSession should be deleted. - */ + + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardContentDAO#removeNbSessions(org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent)*/ public void removeNbSessions(NoticeboardContent nbContent) { this.getHibernateTemplate().deleteAll(nbContent.getNbSessions()); } - /** - *Creates a persistent instance of NoticeboardSession which is associated
- * with the NoticeboardContent with tool content id nbContentId
- *
Hibernate implementation for database access to Noticeboard sessions for the noticeboard tool.
*/ public class NoticeboardSessionDAO extends HibernateDaoSupport implements INoticeboardSessionDAO { @@ -44,32 +44,15 @@ private static final String GET_SESSIONS_FROM_CONTENT = "select ns.nbSessionId from NoticeboardSession ns where ns.nbContent= :nbContent"; - - - - /** - *Return the persistent instance of a NoticeboardSession
- * with the given identifier uid
, returns null if not found.
Return the persistent instance of a NoticeboardSession
- * with the given tool session id nbSessionId
,
- * returns null if not found.
Persist the given persistent instance of NoticeboardSession.
- * - * @param nbSession The instance of NoticeboardSession to persist. - */ - public void saveNbSession(NoticeboardSession nbSession) + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardSessionDAO#saveNbSession(org.lamsfoundation.lams.tool.noticeboard.NoticeboardSession) */ + public void saveNbSession(NoticeboardSession nbSession) { this.getHibernateTemplate().save(nbSession); } - /** - *Update the given persistent instance of NoticeboardSession.
- * - * @param nbContent The instance of NoticeboardSession to persist. - */ + + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardSessionDAO#updateNbSession(org.lamsfoundation.lams.tool.noticeboard.NoticeboardSession) */ public void updateNbSession(NoticeboardSession nbSession) { this.getHibernateTemplate().update(nbSession); } - /** - *Delete the given instance of NoticeboardSession with the
- * given identifier uid
- *
- * @param uid an identifier for the NoticeboardSession instance.
- */
+
+ /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardSessionDAO#removeNbSessionByUID(java.lang.Long) */
public void removeNbSessionByUID(Long uid)
{
NoticeboardSession nb = (NoticeboardSession)getHibernateTemplate().get(NoticeboardSession.class, uid);
this.getHibernateTemplate().delete(nb);
}
- /**
- *
Delete the given instance of NoticeboardSession with the
- * given tool session id nbSessionid
- *
- * @param nbSessionId The tool session Id.
- */
+ /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardSessionDAO#removeNbSession(java.lang.Long) */
public void removeNbSession(Long nbSessionId)
{
String query = "from NoticeboardSession as nbS where nbS.nbSessionId =";
@@ -134,25 +100,15 @@
this.getHibernateTemplate().delete(queryString);
}
- /**
- *
Delete the given instance of NoticeboardSession
- * - * @param nbSession The instance of NoticeboardSession to delete. - */ + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardSessionDAO#removeNbSession(org.lamsfoundation.lams.tool.noticeboard.NoticeboardSession) */ public void removeNbSession(NoticeboardSession nbSession) { this.getHibernateTemplate().delete(nbSession); } - /** - * Returns the persistent instance of NoticeboardSession
- * associated with the given noticeboard user, with user id userId
,
- * returns null if not found.
- *
- * @param userId The noticeboard user id
- * @return a persistent instance of NoticeboardSessions or null if not found.
- */
- public NoticeboardSession getNbSessionByUser(final Long userId)
+
+ /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardSessionDAO#getNbSessionByUser(java.lang.Long) */
+ public NoticeboardSession getNbSessionByUser(final Long userId)
{
return (NoticeboardSession) getHibernateTemplate().execute(new HibernateCallback()
{
@@ -167,25 +123,16 @@
});
}
- /**
- *
Deletes all instances of NoticeboardUser that are associated - * with the given instance of NoticeboardSession
- * - * @param nbSession The instance of NoticeboardSession in which corresponding instances of NoticeboardUser should be deleted. - */ - public void removeNbUsers(NoticeboardSession nbSession) + + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardSessionDAO#removeNbUsers(org.lamsfoundation.lams.tool.noticeboard.NoticeboardSession) */ + public void removeNbUsers(NoticeboardSession nbSession) { this.getHibernateTemplate().deleteAll(nbSession.getNbUsers()); } - /** - *Creates and persists an instance of NoticeboardUser which is associated
- * with the NoticeboardSession with tool session id nbSessionId
Hibernate implementation for database access to Noticeboard users (learners) for the noticeboard tool.
*/ public class NoticeboardUserDAO extends HibernateDaoSupport implements INoticeboardUserDAO { private static final String COUNT_USERS_IN_SESSION = "select nu.userId from NoticeboardUser nu where nu.nbSession= :nbSession"; - /** - *Return the persistent instance of a NoticeboardUser
- * with the given identifier uid
, returns null if not found.
Return the persistent instance of a NoticeboardUser
- * with the given user id userId
,
- * returns null if not found.
Persist the given persistent instance of NoticeboardUser.
- * - * @param nbUser The instance of NoticeboardUser to persist. - */ + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardUserDAO#saveNbUser(org.lamsfoundation.lams.tool.noticeboard.NoticeboardUser) */ public void saveNbUser(NoticeboardUser nbUser) { this.getHibernateTemplate().save(nbUser); } - /** - *Update the given persistent instance of NoticeboardUser.
- * - * @param nbUser The instance of NoticeboardUser to persist. - */ + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardUserDAO#updateNbUser(org.lamsfoundation.lams.tool.noticeboard.NoticeboardUser) */ public void updateNbUser(NoticeboardUser nbUser) { this.getHibernateTemplate().update(nbUser); } - /** - *Delete the given instance of NoticeboardUser with the
- * given user id userId
- *
- * @param userId The noticeboard user id.
- */
+ /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardUserDAO#removeNbUser(java.lang.Long) */
public void removeNbUser(Long userId)
{
String query = "from NoticeboardUser as user where user.userId =";
@@ -112,23 +87,14 @@
this.getHibernateTemplate().delete(queryString);
}
- /**
- *
Delete the given instance of NoticeboardUser
- * - * @param nbUser The instance of NoticeboardUser to delete. - */ + + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardUserDAO#removeNbUser(org.lamsfoundation.lams.tool.noticeboard.NoticeboardUser) */ public void removeNbUser(NoticeboardUser nbUser) { this.getHibernateTemplate().delete(nbUser); } - /** - * Returns the number of users that are in this particular - * session. - * - * @param nbSession - * @return the number of users that are in this session - */ + /** @see org.lamsfoundation.lams.tool.noticeboard.dao.INoticeboardUserDAO#getNumberOfUsers((org.lamsfoundation.lams.tool.noticeboard.NoticeboardSession) */ public int getNumberOfUsers(NoticeboardSession nbSession) { return (getHibernateTemplate().findByNamedParam(COUNT_USERS_IN_SESSION,