Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java =================================================================== diff -u -rb346aae6594fa9506dc251c38dc968cfa977b8da -ra0d800ce3c0a024c11d939cd81514a185247e44e --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision b346aae6594fa9506dc251c38dc968cfa977b8da) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision a0d800ce3c0a024c11d939cd81514a185247e44e) @@ -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.