Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java
===================================================================
diff -u -r6847f3627bbb8393b88988cae6c3cd8ad97f1600 -r97f2318395de13f34d37cec08c50bc379b7ece13
--- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision 6847f3627bbb8393b88988cae6c3cd8ad97f1600)
+++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision 97f2318395de13f34d37cec08c50bc379b7ece13)
@@ -75,13 +75,13 @@
private IRepositoryService repositoryService;
- public Forum editForum(Forum forum) throws PersistenceException {
+ public Forum updateForum(Forum forum) throws PersistenceException {
forumDao.saveOrUpdate(forum);
return forum;
}
- public Forum getForum(Long forumId) throws PersistenceException {
- return (Forum) forumDao.getById(forumId);
+ public Forum getForum(Long forumUid) throws PersistenceException {
+ return (Forum) forumDao.getById(forumUid);
}
public Forum getForumByContentId(Long contentID) throws PersistenceException {
@@ -91,15 +91,10 @@
}
return forum;
}
- public void deleteForum(Long forumId) throws PersistenceException {
- Forum forum = this.getForum(forumId);
- forumDao.delete(forum);
- }
public void deleteForumAttachment(Long attachmentId) throws PersistenceException {
Attachment attachment = (Attachment) attachmentDao.getById(attachmentId);
attachmentDao.delete(attachment);
-
}
public Message createRootTopic(Long forumId, Long sessionId, Message message) throws PersistenceException {
@@ -192,60 +187,6 @@
return replyMessage;
}
- public AttachmentDao getAttachmentDao() {
- return attachmentDao;
- }
-
- public void setAttachmentDao(AttachmentDao attachmentDao) {
- this.attachmentDao = attachmentDao;
- }
-
- public ForumDao getForumDao() {
- return forumDao;
- }
-
- public void setForumDao(ForumDao forumDao) {
- this.forumDao = forumDao;
- }
-
- public MessageDao getMessageDao() {
- return messageDao;
- }
-
- public void setMessageDao(MessageDao messageDao) {
- this.messageDao = messageDao;
- }
-
- public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException {
- }
-
- public void setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException {
- }
-
- public void setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException {
- }
-
- public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException {
- }
-
- public void createToolSession(Long toolSessionId, Long toolContentId) throws ToolException {
- }
-
- public String leaveToolSession(Long toolSessionId, User learner) throws DataMissingException, ToolException {
- return null;
- }
-
- public ToolSessionExportOutputData exportToolSession(Long toolSessionId) throws DataMissingException, ToolException {
- return null;
- }
-
- public ToolSessionExportOutputData exportToolSession(List toolSessionIds) throws DataMissingException, ToolException {
- return null;
- }
-
- public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException {
- }
-
public Attachment uploadInstructionFile(FormFile uploadFile, String fileType) throws PersistenceException{
if(uploadFile == null || StringUtils.isEmpty(uploadFile.getFileName()))
throw new ForumException("Could not find upload file: " + uploadFile);
@@ -263,35 +204,7 @@
return file;
}
- /**
- * Process an uploaded file.
- *
- * @param forumForm
- * @throws FileNotFoundException
- * @throws IOException
- * @throws RepositoryCheckedException
- * @throws InvalidParameterException
- */
- private NodeKey processFile(FormFile file, String fileType){
- NodeKey node = null;
- if (file!= null && !StringUtils.isEmpty(file.getFileName())) {
- String fileName = file.getFileName();
- try {
- node = getToolContentHandler().uploadFile(file.getInputStream(), fileName,
- file.getContentType(), fileType);
- } catch (InvalidParameterException e) {
- throw new ForumException("FileNotFoundException occured while trying to upload File" + e.getMessage());
- } catch (FileNotFoundException e) {
- throw new ForumException("FileNotFoundException occured while trying to upload File" + e.getMessage());
- } catch (RepositoryCheckedException e) {
- throw new ForumException("FileNotFoundException occured while trying to upload File" + e.getMessage());
- } catch (IOException e) {
- throw new ForumException("FileNotFoundException occured while trying to upload File" + e.getMessage());
- }
- }
- return node;
- }
-
+
/**
* This method deletes the content with the given uuid
and
* versionID
from the content repository
@@ -314,55 +227,7 @@
}
}
- public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type){
- forumDao.deleteInstrcutionFile(contentID, uuid, versionID, type);
- }
- public ForumToolContentHandler getToolContentHandler() {
- return toolContentHandler;
- }
-
- public void setToolContentHandler(ForumToolContentHandler toolContentHandler) {
- this.toolContentHandler = toolContentHandler;
- }
- /**
- * This method verifies the credentials of the SubmitFiles Tool and gives it
- * the Ticket
to login and access the Content Repository.
- *
- * A valid ticket is needed in order to access the content from the
- * repository. This method would be called evertime the tool needs to
- * upload/download files from the content repository.
- *
- * @return ITicket The ticket for repostory access
- * @throws SubmitFilesException
- */
- private ITicket getRepositoryLoginTicket() throws ForumException {
- ICredentials credentials = new SimpleCredentials(
- toolContentHandler.getRepositoryUser(),
- toolContentHandler.getRepositoryId());
- try {
- ITicket ticket = repositoryService.login(credentials,
- toolContentHandler.getRepositoryWorkspaceName());
- return ticket;
- } catch (AccessDeniedException ae) {
- throw new ForumException("Access Denied to repository."
- + ae.getMessage());
- } catch (WorkspaceNotFoundException we) {
- throw new ForumException("Workspace not found."
- + we.getMessage());
- } catch (LoginException e) {
- throw new ForumException("Login failed." + e.getMessage());
- }
- }
-
- public IRepositoryService getRepositoryService() {
- return repositoryService;
- }
-
- public void setRepositoryService(IRepositoryService repositoryService) {
- this.repositoryService = repositoryService;
- }
-
public Attachment uploadAttachment(FormFile uploadFile) throws PersistenceException {
if(uploadFile == null || StringUtils.isEmpty(uploadFile.getFileName()))
throw new ForumException("Could not find upload file: " + uploadFile);
@@ -415,9 +280,6 @@
return MessageDTO.getMessageDTO(new ArrayList(map.values()));
}
- public Forum createForum(Long contentId) throws PersistenceException {
- return null;
- }
public ForumUser getUserByUserId(Long userId) {
List list = forumUserDao.getUserByUserId(userId);
@@ -430,54 +292,10 @@
public void createUser(ForumUser forumUser) {
forumUserDao.save(forumUser);
}
-
- public ForumUserDao getForumUserDao() {
- return forumUserDao;
- }
-
- public void setForumUserDao(ForumUserDao forumUserDao) {
- this.forumUserDao = forumUserDao;
- }
-
public ForumToolSession getSessionBySessionId(Long sessionId) {
return forumToolSessionDao.getBySessionId(sessionId);
}
-
- /**
- * @param map
- * @return
- */
- private List getSortedMessageDTO(SortedMap map) {
- Iterator iter;
- MessageSeq msgSeq;
- List msgDtoList = new ArrayList();
- iter =map.entrySet().iterator();
- while(iter.hasNext()){
- Map.Entry entry = (Entry) iter.next();
- msgSeq = (MessageSeq) entry.getKey();
- MessageDTO dto = MessageDTO.getMessageDTO((Message) entry.getValue());
- dto.setLevel(msgSeq.getMessageLevel());
- msgDtoList.add(dto);
- }
- return msgDtoList;
- }
- public MessageSeqDao getMessageSeqDao() {
- return messageSeqDao;
- }
-
- public void setMessageSeqDao(MessageSeqDao messageSeqDao) {
- this.messageSeqDao = messageSeqDao;
- }
-
- public ForumToolSessionDao getForumToolSessionDao() {
- return forumToolSessionDao;
- }
-
- public void setForumToolSessionDao(ForumToolSessionDao forumToolSessionDao) {
- this.forumToolSessionDao = forumToolSessionDao;
- }
-
public Long getRootTopicId(Long topicId) {
MessageSeq seq = messageSeqDao.getByTopicId(topicId);
if(seq == null ||seq.getRootMessage() == null){
@@ -495,9 +313,7 @@
public void updateSession(ForumToolSession session) {
forumToolSessionDao.saveOrUpdate(session);
}
- /* (non-Javadoc)
- * @see org.lamsfoundation.lams.tool.sbmt.service.ISubmitFilesService#getToolDefaultContentIdBySignature(java.lang.Long)
- */
+
public Long getToolDefaultContentIdBySignature(String toolSignature)
{
Long contentId = null;
@@ -527,11 +343,193 @@
return forum;
}
+
+
+ //***************************************************************************************************************
+ // ToolContentManager and ToolSessionManager methods
+ //***************************************************************************************************************
+ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException {
+ }
+
+ public void setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException {
+ }
+
+ public void setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException {
+ }
+
+ public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException {
+ }
+
+ public void createToolSession(Long toolSessionId, Long toolContentId) throws ToolException {
+ }
+
+ public String leaveToolSession(Long toolSessionId, User learner) throws DataMissingException, ToolException {
+ return null;
+ }
+
+ public ToolSessionExportOutputData exportToolSession(Long toolSessionId) throws DataMissingException, ToolException {
+ return null;
+ }
+
+ public ToolSessionExportOutputData exportToolSession(List toolSessionIds) throws DataMissingException, ToolException {
+ return null;
+ }
+
+ public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException {
+ }
+
+ //***************************************************************************************************************
+ // Private methods
+ //***************************************************************************************************************
+ /**
+ * @param map
+ * @return
+ */
+ private List getSortedMessageDTO(SortedMap map) {
+ Iterator iter;
+ MessageSeq msgSeq;
+ List msgDtoList = new ArrayList();
+ iter =map.entrySet().iterator();
+ while(iter.hasNext()){
+ Map.Entry entry = (Entry) iter.next();
+ msgSeq = (MessageSeq) entry.getKey();
+ MessageDTO dto = MessageDTO.getMessageDTO((Message) entry.getValue());
+ dto.setLevel(msgSeq.getMessageLevel());
+ msgDtoList.add(dto);
+ }
+ return msgDtoList;
+ }
+ /**
+ * Process an uploaded file.
+ *
+ * @param forumForm
+ * @throws FileNotFoundException
+ * @throws IOException
+ * @throws RepositoryCheckedException
+ * @throws InvalidParameterException
+ */
+ private NodeKey processFile(FormFile file, String fileType){
+ NodeKey node = null;
+ if (file!= null && !StringUtils.isEmpty(file.getFileName())) {
+ String fileName = file.getFileName();
+ try {
+ node = getToolContentHandler().uploadFile(file.getInputStream(), fileName,
+ file.getContentType(), fileType);
+ } catch (InvalidParameterException e) {
+ throw new ForumException("FileNotFoundException occured while trying to upload File" + e.getMessage());
+ } catch (FileNotFoundException e) {
+ throw new ForumException("FileNotFoundException occured while trying to upload File" + e.getMessage());
+ } catch (RepositoryCheckedException e) {
+ throw new ForumException("FileNotFoundException occured while trying to upload File" + e.getMessage());
+ } catch (IOException e) {
+ throw new ForumException("FileNotFoundException occured while trying to upload File" + e.getMessage());
+ }
+ }
+ return node;
+ }
+ /**
+ * This method verifies the credentials of the SubmitFiles Tool and gives it
+ * the Ticket
to login and access the Content Repository.
+ *
+ * A valid ticket is needed in order to access the content from the
+ * repository. This method would be called evertime the tool needs to
+ * upload/download files from the content repository.
+ *
+ * @return ITicket The ticket for repostory access
+ * @throws SubmitFilesException
+ */
+ private ITicket getRepositoryLoginTicket() throws ForumException {
+ ICredentials credentials = new SimpleCredentials(
+ toolContentHandler.getRepositoryUser(),
+ toolContentHandler.getRepositoryId());
+ try {
+ ITicket ticket = repositoryService.login(credentials,
+ toolContentHandler.getRepositoryWorkspaceName());
+ return ticket;
+ } catch (AccessDeniedException ae) {
+ throw new ForumException("Access Denied to repository."
+ + ae.getMessage());
+ } catch (WorkspaceNotFoundException we) {
+ throw new ForumException("Workspace not found."
+ + we.getMessage());
+ } catch (LoginException e) {
+ throw new ForumException("Login failed." + e.getMessage());
+ }
+ }
+
+ //***************************************************************************************************************
+ // Get / Set methods
+ //***************************************************************************************************************
public ILamsToolService getToolService() {
return toolService;
}
public void setToolService(ILamsToolService toolService) {
this.toolService = toolService;
}
+
+ public AttachmentDao getAttachmentDao() {
+ return attachmentDao;
+ }
+
+ public void setAttachmentDao(AttachmentDao attachmentDao) {
+ this.attachmentDao = attachmentDao;
+ }
+
+ public ForumDao getForumDao() {
+ return forumDao;
+ }
+
+ public void setForumDao(ForumDao forumDao) {
+ this.forumDao = forumDao;
+ }
+
+ public MessageDao getMessageDao() {
+ return messageDao;
+ }
+
+ public void setMessageDao(MessageDao messageDao) {
+ this.messageDao = messageDao;
+ }
+
+
+ public MessageSeqDao getMessageSeqDao() {
+ return messageSeqDao;
+ }
+
+ public void setMessageSeqDao(MessageSeqDao messageSeqDao) {
+ this.messageSeqDao = messageSeqDao;
+ }
+
+ public ForumToolSessionDao getForumToolSessionDao() {
+ return forumToolSessionDao;
+ }
+
+ public void setForumToolSessionDao(ForumToolSessionDao forumToolSessionDao) {
+ this.forumToolSessionDao = forumToolSessionDao;
+ }
+
+ public ForumUserDao getForumUserDao() {
+ return forumUserDao;
+ }
+
+ public void setForumUserDao(ForumUserDao forumUserDao) {
+ this.forumUserDao = forumUserDao;
+ }
+
+ public IRepositoryService getRepositoryService() {
+ return repositoryService;
+ }
+
+ public void setRepositoryService(IRepositoryService repositoryService) {
+ this.repositoryService = repositoryService;
+ }
+ public ForumToolContentHandler getToolContentHandler() {
+ return toolContentHandler;
+ }
+
+ public void setToolContentHandler(ForumToolContentHandler toolContentHandler) {
+ this.toolContentHandler = toolContentHandler;
+ }
+
}
Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/IForumService.java
===================================================================
diff -u -r6847f3627bbb8393b88988cae6c3cd8ad97f1600 -r97f2318395de13f34d37cec08c50bc379b7ece13
--- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/IForumService.java (.../IForumService.java) (revision 6847f3627bbb8393b88988cae6c3cd8ad97f1600)
+++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/IForumService.java (.../IForumService.java) (revision 97f2318395de13f34d37cec08c50bc379b7ece13)
@@ -11,31 +11,98 @@
import org.lamsfoundation.lams.tool.forum.persistence.PersistenceException;
/**
- * Created by IntelliJ IDEA.
* User: conradb
* Date: 8/06/2005
* Time: 14:49:59
- * To change this template use File | Settings | File Templates.
*/
public interface IForumService {
-
- public Forum editForum(Forum forum) throws PersistenceException;
- public Forum getForum(Long forumId) throws PersistenceException;
- public Forum getForumByContentId(Long contentID) throws PersistenceException;
+ //************************************************************************************
+ // Forum Method
+ //************************************************************************************
+ /**
+ * Get default content ID by tool signature.
+ * @param toolSignature
+ * @return
+ */
+ public Long getToolDefaultContentIdBySignature(String toolSignature);
+ /**
+ * Get a default instance of Forum by signature of tool.
+ * @return
+ */
+ public Forum getDefaultForum();
- public void deleteForum(Long forumId) throws PersistenceException;
- public void deleteForumAttachment(Long attachmentId) throws PersistenceException;
- public Forum createForum(Long contentId) throws PersistenceException;
-
+ /**
+ * Update forum by given Forum
. If forum does not exist, the create a new forum.
+ * @param forum
+ * @return
+ * @throws PersistenceException
+ */
+ public Forum updateForum(Forum forum) throws PersistenceException;
+ /**
+ * Upload instruction file
+ * @param file
+ * @param type
+ * @return
+ * @throws PersistenceException
+ */
public Attachment uploadInstructionFile(FormFile file, String type) throws PersistenceException;
+ /**
+ * Get forum by forum UID
+ * @param forumUid
+ * @return
+ * @throws PersistenceException
+ */
+ public Forum getForum(Long forumUid) throws PersistenceException;
+ /**
+ * Get forum by forum ID(not record UID)
+ * @param contentID
+ * @return
+ * @throws PersistenceException
+ */
+ public Forum getForumByContentId(Long contentID) throws PersistenceException;
- public Message getMessage(Long messageUid) throws PersistenceException;
-
+ /**
+ * Delete authoring page instruction files.
+ * @param attachmentId
+ * @throws PersistenceException
+ */
+ public void deleteForumAttachment(Long attachmentId) throws PersistenceException;
+ //************************************************************************************
+ //Topic Method
+ //************************************************************************************
+ /**
+ * Create a root topic.
+ * @param forumId
+ * @param sessionId
+ * @param message
+ * @return
+ * @throws PersistenceException
+ */
public Message createRootTopic(Long forumId, Long sessionId, Message message) throws PersistenceException ;
+ /**
+ * Update a topic by give Message
instance.
+ * @param message
+ * @return
+ * @throws PersistenceException
+ */
public Message updateTopic(Message message) throws PersistenceException;
+ /**
+ * Reply a topic.
+ * @param parentId
+ * @param message
+ * @return
+ * @throws PersistenceException
+ */
public Message replyTopic(Long parentId, Message message) throws PersistenceException;
- public void deleteTopic(Long messageId) throws PersistenceException;
+
+ /**
+ * Delete the topic by given topic ID. The function will delete all children topics under this topic.
+ * @param topicId
+ * @throws PersistenceException
+ */
+ public void deleteTopic(Long topicId) throws PersistenceException;
/**
+ * Upload message attachment file into repository.
* This method only upload the given file into system repository. It does not execute any database operation.
*
* @param file
@@ -44,11 +111,20 @@
* @throws PersistenceException
*/
public Attachment uploadAttachment(FormFile file) throws PersistenceException;
- public void deleteInstructionFile(Long contentID, Long uuID, Long versionID, String type) throws PersistenceException;
+
+ /**
+ * Delete file from repository.
+ * @param uuID
+ * @param versionID
+ * @throws PersistenceException
+ */
public void deleteFromRepository(Long uuID, Long versionID) throws PersistenceException;
+ //************************************************************************************
+ //*********************Get topic methods **********************
+ //************************************************************************************
/**
- * Get topics list by given root topic ID.
+ * Get topic and its children list by given root topic ID.
*
* @param rootTopicId
* @return
@@ -59,35 +135,59 @@
* Get root topics by a given sessionID value. Simultanousely, it gets back topics, which author
* posted in authoring page for this forum, which is related with the given sessionID value.
*
+ * This method will used by user to display initial topic page for a forum.
* @param sessionId
* @return
* List of MessageDTO
*/
public List getRootTopics(Long sessionId);
/**
+ * Get topics posted by author role.
* @return
* List of MessageDTO
*/
public List getAuthoredTopics(Long forumId);
-
- public ForumUser getUserByUserId(Long userId);
- public void createUser(ForumUser forumUser);
- public ForumToolSession getSessionBySessionId(Long sessionId);
/**
* This method will look up root topic ID by any level topicID.
* @param topicId
* @return
*/
public Long getRootTopicId(Long topicId);
- public void updateSession(ForumToolSession session);
-
+ /**
+ * Get message by given message UID
+ * @param messageUid
+ * @return
+ * @throws PersistenceException
+ */
+ public Message getMessage(Long messageUid) throws PersistenceException;
+
+ //************************************************************************************
+ // Session Method
+ //************************************************************************************
/**
- * Get default content ID by tool signature.
- * @param toolSignature
+ * Get Forum tool session by Session ID (not record UID).
+ * @param sessionId
* @return
*/
- public Long getToolDefaultContentIdBySignature(String toolSignature);
-
- public Forum getDefaultForum();
+ public ForumToolSession getSessionBySessionId(Long sessionId);
+ /**
+ * Update Forum Tool Session record in database.
+ * @param session
+ */
+ public void updateSession(ForumToolSession session);
+ //************************************************************************************
+ // User Method
+ //************************************************************************************
+ /**
+ * Create a new user in database.
+ * @param forumUser
+ */
+ public void createUser(ForumUser forumUser);
+ /**
+ * Get user by user ID (not record UID).
+ * @param userId
+ * @return
+ */
+ public ForumUser getUserByUserId(Long userId);
}
Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java
===================================================================
diff -u -r6847f3627bbb8393b88988cae6c3cd8ad97f1600 -r97f2318395de13f34d37cec08c50bc379b7ece13
--- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 6847f3627bbb8393b88988cae6c3cd8ad97f1600)
+++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 97f2318395de13f34d37cec08c50bc379b7ece13)
@@ -239,9 +239,8 @@
forumPO = forum;
forumPO.setContentId(forumForm.getToolContentID());
}
- forum = forumService.editForum(forumPO);
+ forum = forumService.updateForum(forumPO);
- //Handle message
//delete message attachment
List topicDeleteAttachmentList = getTopicDeletedAttachmentList(request);
Iterator iter = topicDeleteAttachmentList.iterator();
@@ -252,7 +251,7 @@
}
topicDeleteAttachmentList.clear();
- //handle topic
+ //Handle message
List topics = getTopicList(request);
iter = topics.iterator();
while(iter.hasNext()){
@@ -270,7 +269,7 @@
}
delTopics.clear();
- //re initialize attachmentList
+ //initialize attachmentList again
List attachmentList = getAttachmentList(request);
attachmentList.addAll(forum.getAttachments());
} catch (Exception e) {
@@ -767,25 +766,6 @@
//******************************************************************************************************************
// Private method for internal functions
//******************************************************************************************************************
- /*
- * The private method to get content from ActionForm parameters (web page).
- * @param form
- * @return
- */
-// private Forum getContent(ActionForm form) {
-// ForumForm authForm = (ForumForm) form;
-// Forum forum = authForm.getForum();
-//
-// Forum content = new Forum();
-// try {
-// PropertyUtils.copyProperties(content,forum);
-// } catch (Exception e) {
-// log.error(e);
-// }
-// content.setContentId(authForm.getToolContentID());
-// return content;
-// }
-
private IForumService getForumManager() {
if ( forumService == null ) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext());
Index: lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/service/ForumManagerImplTest.java
===================================================================
diff -u -r7d76f87c9256aa602c7f30415bb8cab963b07936 -r97f2318395de13f34d37cec08c50bc379b7ece13
--- lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/service/ForumManagerImplTest.java (.../ForumManagerImplTest.java) (revision 7d76f87c9256aa602c7f30415bb8cab963b07936)
+++ lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/service/ForumManagerImplTest.java (.../ForumManagerImplTest.java) (revision 97f2318395de13f34d37cec08c50bc379b7ece13)
@@ -31,7 +31,7 @@
Forum inForum = this.getForum("TEST", new Long("1002"), true, true, false, "TEST INSTRUCTIONS", "TEST ONLINEINSTRUCTIONS", "TEST OFFLINEINSTRUCTIONS");
inForum.setAttachments(attachments);
- Forum forum = forumManager.editForum(inForum);
+ Forum forum = forumManager.updateForum(inForum);
assertNotNull("Forum Id is null", forum.getUid());
Forum reloadedForum = forumManager.getForum(forum.getUid());
assertEquals(reloadedForum.getTitle(), "TEST");
@@ -56,7 +56,7 @@
}
public void testCreateAndDeleteForumWithNullAttachments() throws PersistenceException {
- Forum forum = forumManager.editForum(this.getForum("TEST", new Long("1002"), true, true, false, "TEST INSTRUCTIONS", "TEST ONLINEINSTRUCTIONS", "TEST OFFLINEINSTRUCTIONS"));
+ Forum forum = forumManager.updateForum(this.getForum("TEST", new Long("1002"), true, true, false, "TEST INSTRUCTIONS", "TEST ONLINEINSTRUCTIONS", "TEST OFFLINEINSTRUCTIONS"));
assertNotNull("Forum Id is null", forum.getUid());
Forum reloadedForum = forumManager.getForum(forum.getUid());
assertEquals(reloadedForum.getTitle(), "TEST");
@@ -80,7 +80,7 @@
}
public void testCreateAndDeleteForumWithNullInstructions() throws PersistenceException {
- Forum forum = forumManager.editForum(this.getForum("TEST", new Long("1002"), false, false , false, "", "", ""));
+ Forum forum = forumManager.updateForum(this.getForum("TEST", new Long("1002"), false, false , false, "", "", ""));
assertNotNull("Forum Id is null", forum.getUid());
Forum reloadedForum = forumManager.getForum(forum.getUid());
assertEquals(reloadedForum.getTitle(), "TEST");
@@ -104,7 +104,7 @@
}
public void testCreateModifyAndDeleteMessage() throws PersistenceException {
- Forum forum = forumManager.editForum(this.getForum("TEST", new Long("1002"), true, true, false, "TEST INSTRUCTIONS", "TEST ONLINEINSTRUCTIONS", "TEST OFFLINEINSTRUCTIONS"));
+ Forum forum = forumManager.updateForum(this.getForum("TEST", new Long("1002"), true, true, false, "TEST INSTRUCTIONS", "TEST ONLINEINSTRUCTIONS", "TEST OFFLINEINSTRUCTIONS"));
Message message = forumManager.createMessage(forum.getUid(), this.getMessage(new Long("1002"), "TEST", "TEST", true, true));
assertNotNull("Message Id is null", message.getUid());
@@ -143,7 +143,7 @@
}
public void testReplyToMessage() throws PersistenceException {
- Forum forum = forumManager.editForum(this.getForum("TEST", new Long("1002"), true, true, false, "TEST INSTRUCTIONS", "TEST ONLINEINSTRUCTIONS", "TEST OFFLINEINSTRUCTIONS"));
+ Forum forum = forumManager.updateForum(this.getForum("TEST", new Long("1002"), true, true, false, "TEST INSTRUCTIONS", "TEST ONLINEINSTRUCTIONS", "TEST OFFLINEINSTRUCTIONS"));
Message message = forumManager.createMessage(forum.getUid(), this.getMessage(new Long("1002"), "TEST", "TEST", true, true));
assertNotNull("Message Id is null", message.getUid());
Message reloaded = forumManager.getMessage(message.getUid());