Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/AuthoringAction.java =================================================================== diff -u -rd6fa07234d396367e63b1b59db70e70d0e7ccb60 -r91cb4b756363e0a31ae296c829d0d334210de334 --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision d6fa07234d396367e63b1b59db70e70d0e7ccb60) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 91cb4b756363e0a31ae296c829d0d334210de334) @@ -172,11 +172,9 @@ } ToolAccessMode mode = getAccessMode(request); - if (mode.isAuthor()) { - return mapping.findForward(DokumaranConstants.SUCCESS); - } else { - return mapping.findForward(DokumaranConstants.DEFINE_LATER); - } + request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); + + return mapping.findForward(DokumaranConstants.SUCCESS); } /** @@ -203,28 +201,26 @@ // **********************************Get Dokumaran PO********************* Dokumaran dokumaranPO = service.getDokumaranByContentId(dokumaran.getContentId()); if (dokumaranPO == null) { - // new Dokumaran, create it. + // new Dokumaran, create it dokumaranPO = dokumaran; dokumaranPO.setCreated(new Timestamp(new Date().getTime())); dokumaranPO.setUpdated(new Timestamp(new Date().getTime())); + } else { - if (mode.isAuthor()) { - Long uid = dokumaranPO.getUid(); - PropertyUtils.copyProperties(dokumaranPO, dokumaran); + Long uid = dokumaranPO.getUid(); + PropertyUtils.copyProperties(dokumaranPO, dokumaran); - // copyProperties() above may result in "collection assigned to two objects in a session" exception - // Below we remove reference to one of Assessment objects, - // so maybe there will be just one object in session when save is done - // If this fails, we may have to evict the object from session using DAO - dokumaranForm.setDokumaran(null); - dokumaran = null; - // get back UID - dokumaranPO.setUid(uid); - } else { // if it is Teacher, then just update basic tab content - // (definelater) - dokumaranPO.setInstructions(dokumaran.getInstructions()); - dokumaranPO.setTitle(dokumaran.getTitle()); - // change define later status + // copyProperties() above may result in "collection assigned to two objects in a session" exception + // Below we remove reference to one of Assessment objects, + // so maybe there will be just one object in session when save is done + // If this fails, we may have to evict the object from session using DAO + dokumaranForm.setDokumaran(null); + dokumaran = null; + // get back UID + dokumaranPO.setUid(uid); + + // if it's a teacher - change define later status + if (mode.isTeacher()) { dokumaranPO.setDefineLater(false); } dokumaranPO.setUpdated(new Timestamp(new Date().getTime())); @@ -249,11 +245,9 @@ dokumaranForm.setDokumaran(dokumaranPO); request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); - if (mode.isAuthor()) { - return mapping.findForward("author"); - } else { - return mapping.findForward("monitor"); - } + request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); + + return mapping.findForward(DokumaranConstants.SUCCESS); } // ************************************************************************************* Index: lams_tool_doku/web/WEB-INF/struts-config.xml =================================================================== diff -u -r47200ab94fd2651b62702c9e4f2eb6eb989a08c1 -r91cb4b756363e0a31ae296c829d0d334210de334 --- lams_tool_doku/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 47200ab94fd2651b62702c9e4f2eb6eb989a08c1) +++ lams_tool_doku/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 91cb4b756363e0a31ae296c829d0d334210de334) @@ -73,16 +73,14 @@ parameter="initPage" validate="false"> - - - + + @@ -43,35 +44,35 @@ - - <%@ include file="/common/messages.jsp"%> - - - - - - + + <%@ include file="/common/messages.jsp"%> + + + + + + + + + + + + + + <%-- Default value + cancelButtonLabelKey="label.authoring.cancel.button" + saveButtonLabelKey="label.authoring.save.button" + cancelConfirmMsgKey="authoring.msg.cancel.save" + accessMode="author" + --%> + + + + - - - - - - - <%-- Default value - cancelButtonLabelKey="label.authoring.cancel.button" - saveButtonLabelKey="label.authoring.save.button" - cancelConfirmMsgKey="authoring.msg.cancel.save" - accessMode="author" - --%> - - - - - Fisheye: Tag 91cb4b756363e0a31ae296c829d0d334210de334 refers to a dead (removed) revision in file `lams_tool_doku/web/pages/authoring/definelater.jsp'. Fisheye: No comparison available. Pass `N' to diff?