Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsSecurityUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/Attic/LamsSecurityUtil.java,v diff -u -r1.23 -r1.24 --- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsSecurityUtil.java 10 Feb 2015 18:22:06 -0000 1.23 +++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsSecurityUtil.java 10 Feb 2015 22:23:31 -0000 1.24 @@ -361,7 +361,14 @@ String serverAddr = getServerAddress(); String serverKey = getServerKey(); String courseId = ctx.getCourse().getCourseId(); + String username = ctx.getUser().getUserName(); + String firstName = ctx.getUser().getGivenName(); + String lastName = ctx.getUser().getFamilyName(); + String email = ctx.getUser().getEmailAddress(); + String locale = ctx.getUser().getLocale(); + String country = getCountry(locale); + String lang = getLanguage(locale); if (serverId == null || serverAddr == null || serverKey == null) { throw new RuntimeException("Unable to start lesson, one or more lams configuration properties is null"); @@ -375,8 +382,9 @@ String serviceURL = serverAddr + "/services/xml/LessonManager?method=singleStudentProgress" + "&serverId=" + URLEncoder.encode(serverId, "utf8") + "&datetime=" + timestamp + "&username=" + URLEncoder.encode(username, "utf8") + "&hashValue=" + hash + "&courseId=" - + URLEncoder.encode(courseId, "utf8") + "&lsId=" + new Long(lsId).toString() + "&progressUser=" - + URLEncoder.encode(username, "utf8"); + + URLEncoder.encode(courseId, "utf8") + "&country=" + country + "&lang=" + lang + "&firstName=" + + URLEncoder.encode(firstName, "UTF-8") + "&lastName=" + URLEncoder.encode(lastName, "UTF-8") + + "&email=" + URLEncoder.encode(email, "UTF-8") + "&lsId=" + new Long(lsId).toString(); logger.info("Retirieving learner progress: " + serviceURL); Index: lams_central/src/java/org/lamsfoundation/lams/util/CentralConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/util/CentralConstants.java,v diff -u -r1.37 -r1.38 --- lams_central/src/java/org/lamsfoundation/lams/util/CentralConstants.java 15 Jul 2014 08:17:01 -0000 1.37 +++ lams_central/src/java/org/lamsfoundation/lams/util/CentralConstants.java 10 Feb 2015 22:23:34 -0000 1.38 @@ -61,8 +61,6 @@ public static final String PARAM_SVG_FORMAT = "svgFormat"; - public static final String PARAM_PROGRESS_USER = "progressUser"; - public static final String PARAM_MODE = "mode"; public static final String PARAM_FILEPATH = "filePath"; Index: lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java,v diff -u -r1.52 -r1.53 --- lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java 30 Jan 2015 23:25:17 -0000 1.52 +++ lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java 10 Feb 2015 22:23:34 -0000 1.53 @@ -124,7 +124,6 @@ String lang = request.getParameter(CentralConstants.PARAM_LANG); String method = request.getParameter(CentralConstants.PARAM_METHOD); String filePath = request.getParameter(CentralConstants.PARAM_FILEPATH); - String progressUser = request.getParameter(CentralConstants.PARAM_PROGRESS_USER); String outputsUser = request.getParameter("outputsUser"); String learnerIds = request.getParameter(CentralConstants.PARAM_LEARNER_IDS); String monitorIds = request.getParameter(CentralConstants.PARAM_MONITOR_IDS); @@ -197,9 +196,13 @@ element = getAllStudentProgress(document, serverId, datetime, hashValue, username, lsId, courseId); } else if (method.equals(CentralConstants.METHOD_SINGLE_STUDENT_PROGRESS)) { + String firstName = request.getParameter(LoginRequestDispatcher.PARAM_FIRST_NAME); + String lastName = request.getParameter(LoginRequestDispatcher.PARAM_LAST_NAME); + String email = request.getParameter(LoginRequestDispatcher.PARAM_EMAIL); + lsId = new Long(lsIdStr); - element = getSingleStudentProgress(document, serverId, datetime, hashValue, username, lsId, courseId, - progressUser); + element = getSingleStudentProgress(document, serverId, datetime, hashValue, username, firstName, + lastName, lang, country, email, lsId, courseId); } else if (method.equals(CentralConstants.METHOD_IMPORT)) { @@ -435,11 +438,11 @@ } public Element getSingleStudentProgress(Document document, String serverId, String datetime, String hashValue, - String username, long lsId, String courseID, String progressUser) throws RemoteException { + String username, String firstName, String lastName, String language, String country, String email, + long lsId, String courseID) throws RemoteException { try { ExtServerOrgMap serverMap = LessonManagerServlet.integrationService.getExtServerOrgMap(serverId); Authenticator.authenticate(serverMap, datetime, username, hashValue); - ExtUserUseridMap userMap = LessonManagerServlet.integrationService.getExtUserUseridMap(serverMap, username); Lesson lesson = LessonManagerServlet.lessonService.getLesson(lsId); Element element = document.createElement(CentralConstants.ELEM_LESSON_PROGRESS); @@ -448,10 +451,14 @@ if (lesson != null) { int activitiesTotal = lesson.getLearningDesign().getActivities().size(); - ExtUserUseridMap progressUserMap = LessonManagerServlet.integrationService.getExistingExtUserUseridMap( - serverMap, progressUser); + // create new user if required + final boolean usePrefix = true; + final boolean isUpdateUserDetails = false; + ExtUserUseridMap userMap = LessonManagerServlet.integrationService.getImplicitExtUserUseridMap( + serverMap, username, firstName, lastName, language, country, email, usePrefix, + isUpdateUserDetails); - LearnerProgress learnProg = LessonManagerServlet.lessonService.getUserProgressForLesson(progressUserMap + LearnerProgress learnProg = LessonManagerServlet.lessonService.getUserProgressForLesson(userMap .getUser().getUserId(), lsId); Element learnerProgElem = document.createElement(CentralConstants.ELEM_LEARNER_PROGRESS); @@ -472,9 +479,9 @@ learnerProgElem.setAttribute(CentralConstants.ATTR_ACTIVITIES_ATTEMPTED, "" + attemptedActivities); // learnerProgElem.setAttribute(CentralConstants.ATTR_CURRENT_ACTIVITY , currActivity); - learnerProgElem.setAttribute(CentralConstants.ATTR_STUDENT_ID, "" + progressUserMap.getSid()); + learnerProgElem.setAttribute(CentralConstants.ATTR_STUDENT_ID, "" + userMap.getSid()); learnerProgElem.setAttribute(CentralConstants.ATTR_COURSE_ID, courseID); - learnerProgElem.setAttribute(CentralConstants.ATTR_USERNAME, progressUser); + learnerProgElem.setAttribute(CentralConstants.ATTR_USERNAME, username); learnerProgElem.setAttribute(CentralConstants.ATTR_LESSON_ID, "" + lsId); } } else { @@ -484,9 +491,9 @@ learnerProgElem.setAttribute(CentralConstants.ATTR_ACTIVITIES_COMPLETED, "0"); learnerProgElem.setAttribute(CentralConstants.ATTR_ACTIVITIES_ATTEMPTED, "0"); // learnerProgElem.setAttribute(CentralConstants.ATTR_CURRENT_ACTIVITY , currActivity); - learnerProgElem.setAttribute(CentralConstants.ATTR_STUDENT_ID, "" + progressUserMap.getSid()); + learnerProgElem.setAttribute(CentralConstants.ATTR_STUDENT_ID, "" + userMap.getSid()); learnerProgElem.setAttribute(CentralConstants.ATTR_COURSE_ID, courseID); - learnerProgElem.setAttribute(CentralConstants.ATTR_USERNAME, progressUser); + learnerProgElem.setAttribute(CentralConstants.ATTR_USERNAME, username); learnerProgElem.setAttribute(CentralConstants.ATTR_LESSON_ID, "" + lsId); } }