Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolSessionManager.java
===================================================================
diff -u -r8bbaae4777d25bac513a7adc0b42b2d8480e05cc -r0735f8bbbe378127d27795e3d9773f3c1293ed41
--- lams_common/src/java/org/lamsfoundation/lams/tool/ToolSessionManager.java (.../ToolSessionManager.java) (revision 8bbaae4777d25bac513a7adc0b42b2d8480e05cc)
+++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolSessionManager.java (.../ToolSessionManager.java) (revision 0735f8bbbe378127d27795e3d9773f3c1293ed41)
@@ -11,7 +11,7 @@
import java.util.List;
-import org.lamsfoundation.lams.lesson.LearnerProgress;
+import org.lamsfoundation.lams.usermanagement.User;
@@ -37,9 +37,9 @@
/**
* Call the controller service to complete and leave the tool session.
* @param toolSessionId the runtime tool session id.
- * @return the data object that wraps the progess information.
+ * @return the url for next activity.
*/
- public LearnerProgress leaveToolSession(Long toolSessionId);
+ public String leaveToolSession(Long toolSessionId, User learner);
public ToolSessionExportOutputData exportToolSession(Long toolSessionId);
Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java (revision 0735f8bbbe378127d27795e3d9773f3c1293ed41)
@@ -0,0 +1,65 @@
+/*
+ * LamsToolService.java
+ *
+ * Created on 11 January 2005, 13:49
+ */
+
+package org.lamsfoundation.lams.tool.service;
+
+
+import org.lamsfoundation.lams.learningdesign.Activity;
+import org.lamsfoundation.lams.learningdesign.ToolActivity;
+import org.lamsfoundation.lams.lesson.Lesson;
+import org.lamsfoundation.lams.tool.ToolSession;
+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.
+ *
+ * @author Jacky Fang
+ * @since 2005-3-17
+ * @version
+ */
+public interface ILamsCoreToolService
+{
+ /**
+ * Creates a Lams ToolSession for a learner and activity.
+ * @param learner
+ * @param activity
+ */
+ public ToolSession createToolSession(User learner, ToolActivity activity,Lesson lesson) throws LamsToolServiceException;
+
+
+ /**
+ * Returns the previously created ToolSession for a learner and activity.
+ */
+ public ToolSession getToolSessionByLearner(User learner, Activity activity) throws LamsToolServiceException;
+
+ /**
+ * Returns the tool session according to tool session id.
+ * @param toolSessionId the requested tool session id.
+ * @return the tool session object
+ */
+ public ToolSession getToolSessionById(Long toolSessionId);
+
+ /**
+ * Get the lams tool session based on activity and learner.
+ * @param learner
+ * @param toolActivity
+ * @return
+ * @throws LamsToolServiceException
+ */
+ 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);
+
+ public void updateToolSession(ToolSession toolSession);
+
+}
Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java
===================================================================
diff -u -r8bbaae4777d25bac513a7adc0b42b2d8480e05cc -r0735f8bbbe378127d27795e3d9773f3c1293ed41
--- lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java (.../ILamsToolService.java) (revision 8bbaae4777d25bac513a7adc0b42b2d8480e05cc)
+++ lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java (.../ILamsToolService.java) (revision 0735f8bbbe378127d27795e3d9773f3c1293ed41)
@@ -1,21 +1,37 @@
-/*
- * 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;
import java.util.List;
-import org.lamsfoundation.lams.learningdesign.Activity;
-import org.lamsfoundation.lams.learningdesign.ToolActivity;
-import org.lamsfoundation.lams.lesson.Lesson;
-import org.lamsfoundation.lams.tool.ToolSession;
-import org.lamsfoundation.lams.usermanagement.User;
+
/**
- * Interface defines the services LAMS provides for Tools
+ * This interface defines all the service available for self contained tool
+ * module from lams. Any service that would be used by other lams module
+ * such as, lams_learning etc, should not appear in this interface.
+ *
* @author chris
+ * @author Jacky Fang
*/
public interface ILamsToolService
{
@@ -31,36 +47,4 @@
*/
public List getAllPotentialLearners(long toolContentID) throws LamsToolServiceException;
- /**
- * Creates a Lams ToolSession for a learner and activity.
- * @param learner
- * @param activity
- */
- public ToolSession createToolSession(User learner, ToolActivity activity,Lesson lesson) throws LamsToolServiceException;
-
-
- /**
- * Returns the previously created ToolSession for a learner and activity.
- */
- public ToolSession getToolSessionByLearner(User learner, Activity activity) throws LamsToolServiceException;
-
- /**
- * Returns the tool session according to tool session id.
- * @param toolSessionId the requested tool session id.
- * @return the tool session object
- */
- public ToolSession getToolSessionById(Long toolSessionId);
-
-
- 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);
-
- public void updateToolSession(ToolSession toolSession);
}
Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java (revision 0735f8bbbe378127d27795e3d9773f3c1293ed41)
@@ -0,0 +1,200 @@
+/*
+ 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;
+
+import org.lamsfoundation.lams.learningdesign.Activity;
+import org.lamsfoundation.lams.learningdesign.Group;
+import org.lamsfoundation.lams.learningdesign.ToolActivity;
+import org.lamsfoundation.lams.learningdesign.dao.IActivityDAO;
+import org.lamsfoundation.lams.lesson.Lesson;
+import org.lamsfoundation.lams.tool.ToolContentIDGenerator;
+import org.lamsfoundation.lams.tool.ToolContentManager;
+import org.lamsfoundation.lams.tool.ToolSession;
+import org.lamsfoundation.lams.tool.ToolSessionManager;
+import org.lamsfoundation.lams.tool.dao.IToolSessionDAO;
+import org.lamsfoundation.lams.usermanagement.User;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+
+/**
+ *
+ * @author Jacky Fang
+ * @version 1.1
+ * @since 2005-2-23
+ */
+public class LamsCoreToolService implements ILamsCoreToolService,ApplicationContextAware
+{
+ //---------------------------------------------------------------------
+ // Instance variables
+ //---------------------------------------------------------------------
+ private ApplicationContext context;
+ private IToolSessionDAO toolSessionDAO;
+ private IActivityDAO activityDAO;
+ private ToolContentIDGenerator contentIDGenerator;
+ //---------------------------------------------------------------------
+ // Inversion of Control Methods - Method injection
+ //---------------------------------------------------------------------
+ /**
+ * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
+ */
+ public void setApplicationContext(ApplicationContext context) throws BeansException
+ {
+ this.context = context;
+ }
+
+ /**
+ * @param toolSessionDAO The toolSessionDAO to set.
+ */
+ public void setToolSessionDAO(IToolSessionDAO toolSessionDAO)
+ {
+ this.toolSessionDAO = toolSessionDAO;
+ }
+
+ /**
+ * @param contentIDGenerator The contentIDGenerator to set.
+ */
+ public void setContentIDGenerator(ToolContentIDGenerator contentIDGenerator)
+ {
+ this.contentIDGenerator = contentIDGenerator;
+ }
+
+ //---------------------------------------------------------------------
+ // Service Methods
+ //---------------------------------------------------------------------
+
+ /**
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#createToolSession(org.lamsfoundation.lams.usermanagement.User, org.lamsfoundation.lams.learningdesign.Activity)
+ */
+ public ToolSession createToolSession(User learner, ToolActivity activity,Lesson lesson) throws LamsToolServiceException
+ {
+ ToolSession toolSession = activity.createToolSessionForActivity(learner,lesson);
+
+ toolSessionDAO.saveToolSession(toolSession);
+
+ return toolSession;
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#getToolSessionByLearner(org.lamsfoundation.lams.usermanagement.User, org.lamsfoundation.lams.learningdesign.Activity)
+ */
+ public ToolSession getToolSessionByLearner(User learner, Activity activity) throws LamsToolServiceException
+ {
+ return toolSessionDAO.getToolSessionByLearner(learner,activity);
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#getToolSessionById(java.lang.Long)
+ */
+ public ToolSession getToolSessionById(Long toolSessionId)
+ {
+ return toolSessionDAO.getToolSession(toolSessionId);
+ }
+
+ /**
+ * Get the tool session based on the activity id and the learner.
+ * @throws LamsToolServiceException
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#getToolSessionByActivity(org.lamsfoundation.lams.usermanagement.User, ToolActivity)
+ */
+ public ToolSession getToolSessionByActivity(User learner, ToolActivity toolActivity) throws LamsToolServiceException
+ {
+ //TODO need to be changed to grouping flag when grouping activity is mapped
+ //properly.
+ if(toolActivity.getGrouping()!=null)
+ {
+ Group learnerGroup = toolActivity.getGrouping().getGroupBy(learner);
+
+ if(learnerGroup.isNull())
+ throw new LamsToolServiceException("Fail to get grouped tool session: No group found for this learner.");
+
+ return this.toolSessionDAO.getToolSessionByGroup(learnerGroup,toolActivity);
+ }
+ else
+ return this.toolSessionDAO.getToolSessionByLearner(learner,toolActivity);
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#notifyToolsToCreateSession(java.lang.Long, org.lamsfoundation.lams.learningdesign.ToolActivity)
+ */
+ public void notifyToolsToCreateSession(Long toolSessionId, ToolActivity activity)
+ {
+ ToolSessionManager sessionManager = (ToolSessionManager) findToolService(activity);
+
+ sessionManager.createToolSession(toolSessionId,
+ activity.getToolContentId());
+
+ }
+
+ /**
+ * 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)
+ */
+ public Long copyToolContent(ToolActivity toolActivity)
+ {
+ Long newToolcontentID = contentIDGenerator.getNextToolContentIDFor(toolActivity.getTool());
+ //This is just for testing purpose because surveyService is the only
+ //service is available at the moment.
+ //TODO we need to remove this once all done.
+ if (isSurvey(toolActivity))
+ {
+ ToolContentManager contentManager = (ToolContentManager) findToolService(toolActivity);
+ contentManager.copyToolContent(toolActivity.getToolContentId(),
+ newToolcontentID);
+ }
+ return newToolcontentID;
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#updateToolSession(org.lamsfoundation.lams.tool.ToolSession)
+ */
+ public void updateToolSession(ToolSession toolSession)
+ {
+ toolSessionDAO.updateToolSession(toolSession);
+ }
+ //---------------------------------------------------------------------
+ // Helper Methods
+ //---------------------------------------------------------------------
+
+ /**
+ * Find a tool's service registered inside lams. It is implemented using
+ * Spring now. We might need to extract this method to a proxy class to
+ * find different service such as EJB or Web service.
+ * @param toolActivity the tool activity defined in the design.
+ * @return the service object from tool.
+ */
+ private Object findToolService(ToolActivity toolActivity)
+ {
+ return context.getBean(toolActivity.getTool().getServiceName());
+ }
+
+ /**
+ * This is more for testing purpose.
+ * @param toolActivity the tool activity defined in the design.
+ * @return
+ */
+ private boolean isSurvey(ToolActivity toolActivity)
+ {
+ return toolActivity.getTool().getServiceName().equals("surveyService");
+ }
+}
Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java
===================================================================
diff -u -r8bbaae4777d25bac513a7adc0b42b2d8480e05cc -r0735f8bbbe378127d27795e3d9773f3c1293ed41
--- lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java (.../LamsToolService.java) (revision 8bbaae4777d25bac513a7adc0b42b2d8480e05cc)
+++ lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java (.../LamsToolService.java) (revision 0735f8bbbe378127d27795e3d9773f3c1293ed41)
@@ -1,209 +1,46 @@
-/*
- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
- 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;
import java.util.List;
-import org.lamsfoundation.lams.learningdesign.Activity;
-import org.lamsfoundation.lams.learningdesign.Group;
-import org.lamsfoundation.lams.learningdesign.ToolActivity;
-import org.lamsfoundation.lams.learningdesign.dao.IActivityDAO;
-import org.lamsfoundation.lams.lesson.Lesson;
-import org.lamsfoundation.lams.tool.ToolContentIDGenerator;
-import org.lamsfoundation.lams.tool.ToolContentManager;
-import org.lamsfoundation.lams.tool.ToolSession;
-import org.lamsfoundation.lams.tool.ToolSessionManager;
-import org.lamsfoundation.lams.tool.dao.IToolSessionDAO;
-import org.lamsfoundation.lams.usermanagement.User;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-
/**
*
- * @author Jacky Fang
- * @version 1.1
- * @since 2005-2-23
+ * @author Jacky Fang
+ * @since 2005-3-17
+ * @version
+ *
*/
-public class LamsToolService implements ILamsToolService,ApplicationContextAware
+public class LamsToolService implements ILamsToolService
{
- //---------------------------------------------------------------------
- // Instance variables
- //---------------------------------------------------------------------
- private ApplicationContext context;
- private IToolSessionDAO toolSessionDAO;
- private IActivityDAO activityDAO;
- private ToolContentIDGenerator contentIDGenerator;
- //---------------------------------------------------------------------
- // Inversion of Control Methods - Method injection
- //---------------------------------------------------------------------
- /**
- * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
- */
- public void setApplicationContext(ApplicationContext context) throws BeansException
- {
- this.context = context;
- }
-
- /**
- * @param toolSessionDAO The toolSessionDAO to set.
- */
- public void setToolSessionDAO(IToolSessionDAO toolSessionDAO)
- {
- this.toolSessionDAO = toolSessionDAO;
- }
/**
- * @param contentIDGenerator The contentIDGenerator to set.
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#getAllPotentialLearners(long)
*/
- public void setContentIDGenerator(ToolContentIDGenerator contentIDGenerator)
- {
- this.contentIDGenerator = contentIDGenerator;
- }
-
- //---------------------------------------------------------------------
- // Service Methods
- //---------------------------------------------------------------------
- /**
- * @see org.lamsfoundation.lams.tool.service.ILamsToolService#getAllPotentialLearners(long)
- */
public List getAllPotentialLearners(long toolContentID) throws LamsToolServiceException
{
return null;
}
- /**
- * @see org.lamsfoundation.lams.tool.service.ILamsToolService#createToolSession(org.lamsfoundation.lams.usermanagement.User, org.lamsfoundation.lams.learningdesign.Activity)
- */
- public ToolSession createToolSession(User learner, ToolActivity activity,Lesson lesson) throws LamsToolServiceException
- {
- ToolSession toolSession = activity.createToolSessionForActivity(learner,lesson);
-
- toolSessionDAO.saveToolSession(toolSession);
-
- return toolSession;
- }
-
- /**
- * @see org.lamsfoundation.lams.tool.service.ILamsToolService#getToolSessionByLearner(org.lamsfoundation.lams.usermanagement.User, org.lamsfoundation.lams.learningdesign.Activity)
- */
- public ToolSession getToolSessionByLearner(User learner, Activity activity) throws LamsToolServiceException
- {
- return toolSessionDAO.getToolSessionByLearner(learner,activity);
- }
-
- /**
- * @see org.lamsfoundation.lams.tool.service.ILamsToolService#getToolSessionById(java.lang.Long)
- */
- public ToolSession getToolSessionById(Long toolSessionId)
- {
- return toolSessionDAO.getToolSession(toolSessionId);
- }
-
- /**
- * Get the tool session based on the activity id and the learner.
- * @throws LamsToolServiceException
- * @see org.lamsfoundation.lams.tool.service.ILamsToolService#getToolSessionByActivity(org.lamsfoundation.lams.usermanagement.User, ToolActivity)
- */
- public ToolSession getToolSessionByActivity(User learner, ToolActivity toolActivity) throws LamsToolServiceException
- {
- //TODO need to be changed to grouping flag when grouping activity is mapped
- //properly.
- if(toolActivity.getGrouping()!=null)
- {
- Group learnerGroup = toolActivity.getGrouping().getGroupBy(learner);
-
- if(learnerGroup.isNull())
- throw new LamsToolServiceException("Fail to get grouped tool session: No group found for this learner.");
-
- return this.toolSessionDAO.getToolSessionByGroup(learnerGroup,toolActivity);
- }
- else
- return this.toolSessionDAO.getToolSessionByLearner(learner,toolActivity);
- }
-
- /**
- * @see org.lamsfoundation.lams.tool.service.ILamsToolService#notifyToolsToCreateSession(java.lang.Long, org.lamsfoundation.lams.learningdesign.ToolActivity)
- */
- public void notifyToolsToCreateSession(Long toolSessionId, ToolActivity activity)
- {
- ToolSessionManager sessionManager = (ToolSessionManager) findToolService(activity);
-
- sessionManager.createToolSession(toolSessionId,
- activity.getToolContentId());
-
- }
-
- /**
- * 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.ILamsToolService#copyToolContent(org.lamsfoundation.lams.learningdesign.ToolActivity)
- */
- public Long copyToolContent(ToolActivity toolActivity)
- {
- Long newToolcontentID = contentIDGenerator.getNextToolContentIDFor(toolActivity.getTool());
- //This is just for testing purpose because surveyService is the only
- //service is available at the moment.
- //TODO we need to remove this once all done.
- if (isSurvey(toolActivity))
- {
- ToolContentManager contentManager = (ToolContentManager) findToolService(toolActivity);
- contentManager.copyToolContent(toolActivity.getToolContentId(),
- newToolcontentID);
- }
- return newToolcontentID;
- }
-
- /**
- * @see org.lamsfoundation.lams.tool.service.ILamsToolService#updateToolSession(org.lamsfoundation.lams.tool.ToolSession)
- */
- public void updateToolSession(ToolSession toolSession)
- {
- toolSessionDAO.updateToolSession(toolSession);
- }
- //---------------------------------------------------------------------
- // Helper Methods
- //---------------------------------------------------------------------
-
- /**
- * Find a tool's service registered inside lams. It is implemented using
- * Spring now. We might need to extract this method to a proxy class to
- * find different service such as EJB or Web service.
- * @param toolActivity the tool activity defined in the design.
- * @return the service object from tool.
- */
- private Object findToolService(ToolActivity toolActivity)
- {
- return context.getBean(toolActivity.getTool().getServiceName());
- }
-
- /**
- * This is more for testing purpose.
- * @param toolActivity the tool activity defined in the design.
- * @return
- */
- private boolean isSurvey(ToolActivity toolActivity)
- {
- return toolActivity.getTool().getServiceName().equals("surveyService");
- }
}
Index: lams_common/test/java/org/lamsfoundation/lams/tool/ToolDataAccessTestCase.java
===================================================================
diff -u -r8bbaae4777d25bac513a7adc0b42b2d8480e05cc -r0735f8bbbe378127d27795e3d9773f3c1293ed41
--- lams_common/test/java/org/lamsfoundation/lams/tool/ToolDataAccessTestCase.java (.../ToolDataAccessTestCase.java) (revision 8bbaae4777d25bac513a7adc0b42b2d8480e05cc)
+++ lams_common/test/java/org/lamsfoundation/lams/tool/ToolDataAccessTestCase.java (.../ToolDataAccessTestCase.java) (revision 0735f8bbbe378127d27795e3d9773f3c1293ed41)
@@ -13,14 +13,11 @@
import org.lamsfoundation.lams.AbstractLamsTestCase;
import org.lamsfoundation.lams.learningdesign.Group;
-import org.lamsfoundation.lams.learningdesign.Grouping;
import org.lamsfoundation.lams.learningdesign.ToolActivity;
import org.lamsfoundation.lams.learningdesign.dao.IActivityDAO;
import org.lamsfoundation.lams.learningdesign.dao.IGroupDAO;
-import org.lamsfoundation.lams.learningdesign.dao.IGroupingDAO;
import org.lamsfoundation.lams.learningdesign.dao.hibernate.ActivityDAO;
import org.lamsfoundation.lams.learningdesign.dao.hibernate.GroupDAO;
-import org.lamsfoundation.lams.learningdesign.dao.hibernate.GroupingDAO;
import org.lamsfoundation.lams.lesson.Lesson;
import org.lamsfoundation.lams.lesson.dao.ILessonDAO;
import org.lamsfoundation.lams.lesson.dao.hibernate.LessonDAO;
Index: lams_common/test/java/org/lamsfoundation/lams/tool/service/TestLamsToolService.java
===================================================================
diff -u -r8bbaae4777d25bac513a7adc0b42b2d8480e05cc -r0735f8bbbe378127d27795e3d9773f3c1293ed41
--- lams_common/test/java/org/lamsfoundation/lams/tool/service/TestLamsToolService.java (.../TestLamsToolService.java) (revision 8bbaae4777d25bac513a7adc0b42b2d8480e05cc)
+++ lams_common/test/java/org/lamsfoundation/lams/tool/service/TestLamsToolService.java (.../TestLamsToolService.java) (revision 0735f8bbbe378127d27795e3d9773f3c1293ed41)
@@ -36,15 +36,15 @@
*/
public class TestLamsToolService extends ToolDataAccessTestCase
{
- private ILamsToolService toolService;
+ private ILamsCoreToolService toolService;
/*
* @see ToolDataAccessTestCase#setUp()
*/
protected void setUp() throws Exception
{
super.setUp();
- toolService = (ILamsToolService) this.context.getBean("lamsToolService");
+ toolService = (ILamsCoreToolService) this.context.getBean("lamsCoreToolService");
toolSessionDao = (ToolSessionDAO)this.context.getBean("toolSessionDAO");
Index: lams_common/test/java/org/lamsfoundation/lams/tool/toolApplicationContext.xml
===================================================================
diff -u -r7def51eecc3d871673b614e8cb9a1ffc87a98881 -r0735f8bbbe378127d27795e3d9773f3c1293ed41
--- lams_common/test/java/org/lamsfoundation/lams/tool/toolApplicationContext.xml (.../toolApplicationContext.xml) (revision 7def51eecc3d871673b614e8cb9a1ffc87a98881)
+++ lams_common/test/java/org/lamsfoundation/lams/tool/toolApplicationContext.xml (.../toolApplicationContext.xml) (revision 0735f8bbbe378127d27795e3d9773f3c1293ed41)
@@ -32,16 +32,16 @@
-
-
+
-
+
PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED
@@ -52,4 +52,19 @@
+
+
+
+
+
+
+
+
+ PROPAGATION_REQUIRED,readOnly
+
+
+
+