Index: lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java =================================================================== diff -u -r2962a623ecfbd3460df3e34aa323e0cdc65438bd -r8ea17868afd6bfcb9481c78254ded0f4d86cb251 --- lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java (.../Tool.java) (revision 2962a623ecfbd3460df3e34aa323e0cdc65438bd) +++ lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java (.../Tool.java) (revision 8ea17868afd6bfcb9481c78254ded0f4d86cb251) @@ -89,10 +89,8 @@ } /** - * @hibernate.id - * generator-class="identity" - * type="java.lang.Long" - * column="tool_id" + * @hibernate.id generator-class="identity" type="java.lang.Long" + * column="tool_id" * */ public Long getToolId() { Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java =================================================================== diff -u -r884b5578b8b6b8a5c269f87ac6c634abbe916455 -r8ea17868afd6bfcb9481c78254ded0f4d86cb251 --- lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java (.../ILamsCoreToolService.java) (revision 884b5578b8b6b8a5c269f87ac6c634abbe916455) +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java (.../ILamsCoreToolService.java) (revision 8ea17868afd6bfcb9481c78254ded0f4d86cb251) @@ -1,9 +1,26 @@ -/* - * LamsToolService.java - * - * Created on 11 January 2005, 13:49 - */ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ + package org.lamsfoundation.lams.tool.service; @@ -15,24 +32,33 @@ import org.lamsfoundation.lams.usermanagement.User; /** - * This interface defines the service that lams tool package offers to other - * lams core modules, such as, lams_learning, lams_authoring, lams_monitoring. + *
This interface defines the service that lams tool package offers to other + * lams core modules, such as, lams_learning, lams_authoring, lams_monitoring.
* + *It doesn't have the tool service that will be called by the tool.
+ * + * * @author Jacky Fang * @since 2005-3-17 - * @version + * @version 1.1 */ public interface ILamsCoreToolService { /** * Creates a Lams ToolSession for a learner and activity. - * @param learner - * @param activity + * @param learner the learner who is running the activity. + * @param activity the requested activity. */ public ToolSession createToolSession(User learner, ToolActivity activity,Lesson lesson) throws LamsToolServiceException; /** * Returns the previously created ToolSession for a learner and activity. + * It is queried base on learner. + * @param learner the learner who owns the tool session. + * @param activity the activity that associate with the tool session. + * @return the requested tool session. + * @throws LamsToolServiceException the known error condition when we + * are getting the tool session */ public ToolSession getToolSessionByLearner(User learner, Activity activity) throws LamsToolServiceException; @@ -44,22 +70,38 @@ public ToolSession getToolSessionById(Long toolSessionId); /** - * Get the lams tool session based on activity and learner. - * @param learner - * @param toolActivity - * @return - * @throws LamsToolServiceException + * Get the lams tool session based on activity. It search through all + * the tool sessions that linked to the requested activity and return + * the tool session with requested learner information. + * + * @param learner the requested learner + * @param toolActivity the requested activity. + * @return the tool session. + * @throws LamsToolServiceException the known error condition when we + * are getting the tool session */ public ToolSession getToolSessionByActivity(User learner, ToolActivity toolActivity)throws LamsToolServiceException; + /** * Notify tools to create their tool sessions in their own tables. * @param toolSessionId the tool session generated by lams. * @param activity the activity correspondent to that tool session. */ public void notifyToolsToCreateSession(Long toolSessionId, ToolActivity activity); - public Long copyToolContent(ToolActivity toolActivity); + /** + * Notify a tool to make a copy of its own content. Lams needs to dynamically + * load tool's service by request and invoke the copy method from tool + * content manager. + * @param toolActivity the requested tool activity. + * @return new tool content id. + */ + public Long notifyToolToCopyContent(ToolActivity toolActivity); + /** + * Update the tool session data. + * @param toolSession the new tool session object. + */ public void updateToolSession(ToolSession toolSession); /** Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java =================================================================== diff -u -r884b5578b8b6b8a5c269f87ac6c634abbe916455 -r8ea17868afd6bfcb9481c78254ded0f4d86cb251 --- lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java (.../LamsCoreToolService.java) (revision 884b5578b8b6b8a5c269f87ac6c634abbe916455) +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java (.../LamsCoreToolService.java) (revision 8ea17868afd6bfcb9481c78254ded0f4d86cb251) @@ -150,9 +150,9 @@ * Make a copy of all tools content which belongs to this learning design. * * @param toolActivity the tool activity defined in the design. - * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#copyToolContent(org.lamsfoundation.lams.learningdesign.ToolActivity) + * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#notifyToolToCopyContent(org.lamsfoundation.lams.learningdesign.ToolActivity) */ - public Long copyToolContent(ToolActivity toolActivity) + public Long notifyToolToCopyContent(ToolActivity toolActivity) { Long newToolcontentID = contentIDGenerator.getNextToolContentIDFor(toolActivity.getTool()); //This is just for testing purpose because surveyService is the only