Index: lams_central/src/java/org/lamsfoundation/lams/webservice/LearningDesignSVGServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/webservice/LearningDesignSVGServlet.java,v diff -u -r1.7.2.3 -r1.7.2.4 --- lams_central/src/java/org/lamsfoundation/lams/webservice/LearningDesignSVGServlet.java 28 Sep 2016 15:13:38 -0000 1.7.2.3 +++ lams_central/src/java/org/lamsfoundation/lams/webservice/LearningDesignSVGServlet.java 20 Dec 2016 10:40:31 -0000 1.7.2.4 @@ -39,6 +39,7 @@ import org.lamsfoundation.lams.integration.service.IntegrationService; import org.lamsfoundation.lams.learningdesign.service.ILearningDesignService; import org.lamsfoundation.lams.learningdesign.service.LearningDesignService; +import org.lamsfoundation.lams.lesson.service.ILessonService; import org.lamsfoundation.lams.util.CentralConstants; import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.ConfigurationKeys; @@ -55,6 +56,8 @@ private static IntegrationService integrationService = null; private ILearningDesignService learningDesignService = null; + + private ILessonService lessonService = null; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -64,7 +67,11 @@ String hashValue = request.getParameter(CentralConstants.PARAM_HASH_VALUE); String username = request.getParameter(CentralConstants.PARAM_USERNAME); - Long learningDesignId = WebUtil.readLongParam(request, CentralConstants.PARAM_LEARNING_DESIGN_ID); + // in case lsId parameter is provided - get learningDesignId from the responsible lesson, otherwise try to get + // it from a request as "ldId" parameter + Long lessonId = WebUtil.readLongParam(request, CentralConstants.PARAM_LESSON_ID, true); + Long learningDesignId = (lessonId == null) ? WebUtil.readLongParam(request, CentralConstants.PARAM_LEARNING_DESIGN_ID) : + lessonService.getLessonDetails(lessonId).getLearningDesignID(); if (serverId == null || datetime == null || hashValue == null || username == null) { String msg = "Parameters missing"; @@ -129,5 +136,8 @@ learningDesignService = (ILearningDesignService) WebApplicationContextUtils .getRequiredWebApplicationContext(getServletContext()).getBean("learningDesignService"); + + lessonService = (ILessonService) WebApplicationContextUtils + .getRequiredWebApplicationContext(getServletContext()).getBean("lessonService"); } } \ No newline at end of file