Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java,v diff -u -r1.33 -r1.34 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java 18 Dec 2005 23:20:08 -0000 1.33 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java 19 Dec 2005 19:17:00 -0000 1.34 @@ -49,6 +49,7 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; +import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McApplicationException; import org.lamsfoundation.lams.tool.mc.McComparator; @@ -122,7 +123,35 @@ logger.debug("forwarding to: " + LOAD_QUESTIONS); return (mapping.findForward(LOAD_QUESTIONS)); } - + + + /* test whether the authoring level tool contract: + public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException; + * is working or not + */ + String copyToolContent= (String) request.getParameter(COPY_TOOL_CONTENT); + logger.debug("copyToolContent: " + copyToolContent); + + if ((copyToolContent != null) && (copyToolContent.equals("1"))) + { + logger.debug("user request to copy the content"); + Long fromContentId=new Long(strToolContentId); + logger.debug("fromContentId: " + fromContentId); + + Long toContentId=new Long(McUtils.generateId()); + logger.debug("toContentId: " + toContentId); + + try + { + mcService.copyToolContent(fromContentId, toContentId); + } + catch(ToolException e) + { + logger.debug("error copying the content: " + e); + } + } + + /* * find out if the passed tool content id exists in the db * present user either a first timer screen with default content data or fetch the existing content.