Index: lams_tool_forum/conf/xdoclet/servlets.xml =================================================================== diff -u -rfd1d19665518ba6781ce9e3851889c077e8efff4 -r8e35715613755a1ea9c9e22a374f431434dcaead --- lams_tool_forum/conf/xdoclet/servlets.xml (.../servlets.xml) (revision fd1d19665518ba6781ce9e3851889c077e8efff4) +++ lams_tool_forum/conf/xdoclet/servlets.xml (.../servlets.xml) (revision 8e35715613755a1ea9c9e22a374f431434dcaead) @@ -9,7 +9,7 @@ org.apache.struts.action.ActionServlet config - /WEB-INF/struts/struts-config.xml + /WEB-INF/struts-config.xml debug Index: lams_tool_forum/conf/xdoclet/struts-actions.xml =================================================================== diff -u -rfd1d19665518ba6781ce9e3851889c077e8efff4 -r8e35715613755a1ea9c9e22a374f431434dcaead --- lams_tool_forum/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision fd1d19665518ba6781ce9e3851889c077e8efff4) +++ lams_tool_forum/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 8e35715613755a1ea9c9e22a374f431434dcaead) @@ -74,10 +74,25 @@ + parameter="deleteTopic"> + + + + + + + Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java =================================================================== diff -u -rfd1d19665518ba6781ce9e3851889c077e8efff4 -r8e35715613755a1ea9c9e22a374f431434dcaead --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision fd1d19665518ba6781ce9e3851889c077e8efff4) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision 8e35715613755a1ea9c9e22a374f431434dcaead) @@ -63,7 +63,7 @@ } forum.setAttachments(documents); } - forumDao.saveOrUpdate(forum); + forumDao.save(forum); //save topics of forum if (topics != null && topics.size() !=0) { Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java =================================================================== diff -u -rfd1d19665518ba6781ce9e3851889c077e8efff4 -r8e35715613755a1ea9c9e22a374f431434dcaead --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision fd1d19665518ba6781ce9e3851889c077e8efff4) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 8e35715613755a1ea9c9e22a374f431434dcaead) @@ -24,6 +24,7 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.Date; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; @@ -79,6 +80,12 @@ if (param.equals("deleteTopic")) { return deleteTopic(mapping, form, request, response); } + if (param.equals("viewTopic")) { + return viewTopic(mapping, form, request, response); + } + if (param.equals("finishTopic")) { + return finishTopic(mapping, form, request, response); + } if (param.equals("updateContent")) { return updateContent(mapping, form, request, response); } @@ -111,7 +118,7 @@ Long contentId = new Long(WebUtil.readLongParam(request,AttributeNames.TOOL_CONTENT_ID)); - + ForumForm forumForm = (ForumForm)form; //get back the topic list and display them on page forumService = getForumManager(); @@ -121,17 +128,16 @@ forum = forumService.getForumByContentId(contentId); if(forum != null){ topics = forumService.getTopics(forum.getUid()); - ((ForumForm)form).setForum(forum); + forumForm.setForum(forum); } - ((ForumForm)form).setToolContentID(contentId); + forumForm.setToolContentID(contentId); } catch (PersistenceException e) { log.error(e); return mapping.findForward("error"); } //set back STRUTS component value - request.setAttribute(ForumConstants.AUTHORING_TOPICS_LIST,topics); - request.setAttribute(ForumConstants.AUTHORING_DTO,forum); + request.getSession().setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, topics); return mapping.findForward("success"); } @@ -158,6 +164,7 @@ topics = new ArrayList(); } topics.add(message); + request.getSession().setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, topics); return mapping.findForward("success"); } @@ -175,7 +182,7 @@ } request.getSession().setAttribute(ForumConstants.AUTHORING_TOPICS_LIST,topics); } - + StringBuffer sb = new StringBuffer(); sb.append(""); sb.append(""); @@ -206,7 +213,23 @@ } return null; } - + public ActionForward viewTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws PersistenceException { + //TODO + return null; + + } + + public ActionForward finishTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws PersistenceException { + List topics = (List) request.getSession().getAttribute(ForumConstants.AUTHORING_TOPICS_LIST); + ForumForm forumForm = (ForumForm)form; + //TODO: topic sequence not write + forumForm.getForum().setMessages(new HashSet(topics)); + + return mapping.findForward("success"); + + } /** * Update all content for submit tool except online/offline instruction * files list. @@ -226,16 +249,18 @@ Set attachment = forum.getAttachments(); try { forumService = getForumManager(); - Forum persistContent = forumService.getForum(forum.getContentId()); - if(forum.getContentId().equals(persistContent.getContentId())){ + Forum persistContent = forumService.getForumByContentId(forumForm.getToolContentID()); + if(persistContent != null && forum.getContentId().equals(persistContent.getContentId())){ //keep Set type attribute for persist content becuase this update only //include updating simple properties from web page(i.e. text value, list value, etc) //copy web page value into persist content, as above, the "Set" type value kept. PropertyUtils.copyProperties(persistContent,forum); forumService.editForum(persistContent,attachment,topics); - }else + }else{ + forum.setContentId(forumForm.getToolContentID()); forumService.createForum(forum,attachment,topics); + } } catch (Exception e) { log.error(e); } Index: lams_tool_forum/web/WEB-INF/struts-config.xml =================================================================== diff -u -rfd1d19665518ba6781ce9e3851889c077e8efff4 -r8e35715613755a1ea9c9e22a374f431434dcaead --- lams_tool_forum/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision fd1d19665518ba6781ce9e3851889c077e8efff4) +++ lams_tool_forum/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 8e35715613755a1ea9c9e22a374f431434dcaead) @@ -112,9 +112,22 @@ + parameter="deleteTopic"> + + + + + - - - context - org.springframework.web.context.ContextLoaderServlet + + context + org.springframework.web.context.ContextLoaderServlet + 1 + + + + action + org.apache.struts.action.ActionServlet + + config + /WEB-INF/struts-config.xml + + + debug + 999 + + + detail + 2 + + + validate + true + + 2 + + + + Connector + com.fredck.FCKeditor.connector.ConnectorServlet + + baseDir + /UserFiles/ + + + debug + false + 1 - + - - action - org.apache.struts.action.ActionServlet - - config - /WEB-INF/struts-config.xml - - - debug - 999 - - - detail - 2 - - - validate - true - - 2 - Instructions Download @@ -108,15 +110,21 @@ 3 - - action - *.do - - - download - /download/* - + + action + *.do + + + Connector + /editor/filemanager/browser/default/connectors/jsp/connector + + + + download + /download/* + + 120 Index: lams_tool_forum/web/jsps/authoring/message/create.jsp =================================================================== diff -u -rdd63636214e3a807dc010aa392ba85e62fb7dee1 -r8e35715613755a1ea9c9e22a374f431434dcaead --- lams_tool_forum/web/jsps/authoring/message/create.jsp (.../create.jsp) (revision dd63636214e3a807dc010aa392ba85e62fb7dee1) +++ lams_tool_forum/web/jsps/authoring/message/create.jsp (.../create.jsp) (revision 8e35715613755a1ea9c9e22a374f431434dcaead) @@ -1,5 +1,13 @@ <%@ include file="/includes/taglibs.jsp" %> +
- + - + +
   +    +
   - -    + + + + + + + +