Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java,v diff -u -r1.30 -r1.31 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 18 Jul 2006 02:31:54 -0000 1.30 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 21 Jul 2006 01:01:51 -0000 1.31 @@ -610,6 +610,14 @@ return flashMessage.serializeMessage(); } + /** @see org.lamsfoundation.lams.authoring.service.IAuthoringService#copyToolContent(java.lang.Long) */ + public String copyToolContent(Long toolContentID) throws IOException + { + Long newContentID = lamsCoreToolService.notifyToolToCopyContent(toolContentID); + FlashMessage flashMessage = new FlashMessage("copyToolContent", newContentID); + return flashMessage.serializeMessage(); + } + /** @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getAvailableLicenses() */ public Vector getAvailableLicenses() { List licenses = licenseDAO.findAll(License.class); Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java,v diff -u -r1.12 -r1.13 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 18 Jul 2006 02:31:54 -0000 1.12 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 21 Jul 2006 01:01:51 -0000 1.13 @@ -170,6 +170,19 @@ */ public String getToolContentID(Long toolID) throws IOException; + /** + * Calls an appropriate tool to copy the content indicated by toolContentId. + * Returns a string representing the new tool content id in WDDX format. + * + * The is called when the user copies and pastes a tool activity icon in authoring. + * It should only be called on a ToolActivity - never a Gate or Grouping or + * Complex activity. + * + * @param toolContentID The toolContentID indicating the content to copy + * @return String The new tool content id in WDDX Format + */ + public String copyToolContent(Long toolContentID) throws IOException; + /** Get the available licenses. This will include our supported Creative Common * licenses and an "OTHER" license which may be used for user entered license details. * The picture url supplied should be a full URL i.e. if it was a relative URL in the Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java,v diff -u -r1.12 -r1.13 --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 18 Jul 2006 02:31:54 -0000 1.12 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 21 Jul 2006 01:01:51 -0000 1.13 @@ -40,6 +40,7 @@ import org.lamsfoundation.lams.util.audit.IAuditService; import org.lamsfoundation.lams.util.wddx.FlashMessage; import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -171,6 +172,24 @@ } + /** Copy some existing content. Used when the user copies an activity in authoring. + * Expects one parameters - toolContentId (the content to be copied) */ + public ActionForward copyToolContent(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + + String wddxPacket; + IAuthoringService authoringService = getAuthoringService(); + try { + long toolContentID = WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID); + wddxPacket = authoringService.copyToolContent(toolContentID); + } catch (Exception e) { + wddxPacket = handleException(e, "copyToolContent", authoringService).serializeMessage(); + } + return outputPacket(mapping, request, response, wddxPacket, "details"); + + } /** * This method returns a list of all available license in * WDDX format. Index: lams_documents/lams_common/AuthoringDesign.doc =================================================================== RCS file: /usr/local/cvsroot/lams_documents/lams_common/AuthoringDesign.doc,v diff -u -r1.9 -r1.10 Binary files differ