Index: lams_bb_integration/web/admin/config.jsp =================================================================== diff -u -rc42107bc1dd1796f8effeecef9366f0be5795923 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/admin/config.jsp (.../config.jsp) (revision c42107bc1dd1796f8effeecef9366f0be5795923) +++ lams_bb_integration/web/admin/config.jsp (.../config.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -12,7 +12,7 @@ <%@ page import="blackboard.platform.BbServiceManager"%> <%@ page import="blackboard.platform.plugin.PlugInUtil"%> <%@ page import="blackboard.platform.plugin.PlugInException"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsPluginUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.LamsPluginUtil"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> Index: lams_bb_integration/web/admin/config_proc.jsp =================================================================== diff -u -rc42107bc1dd1796f8effeecef9366f0be5795923 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/admin/config_proc.jsp (.../config_proc.jsp) (revision c42107bc1dd1796f8effeecef9366f0be5795923) +++ lams_bb_integration/web/admin/config_proc.jsp (.../config_proc.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -12,7 +12,7 @@ <%@ page import="blackboard.platform.BbServiceManager"%> <%@ page import="blackboard.platform.plugin.PlugInUtil"%> <%@ page import="blackboard.platform.plugin.PlugInException"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsPluginUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.LamsPluginUtil"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> @@ -66,7 +66,7 @@ <%-- Receipt --%>

Sample plugin configured

Index: lams_bb_integration/web/links/author.jsp =================================================================== diff -u -r355d2371b4fbb0a4f1da03c97e5328524d0751e2 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/links/author.jsp (.../author.jsp) (revision 355d2371b4fbb0a4f1da03c97e5328524d0751e2) +++ lams_bb_integration/web/links/author.jsp (.../author.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -1,5 +1,5 @@ <%@ page import="java.util.*, java.net.*, - org.lamsfoundation.ld.integration.blackboard.*" errorPage="error.jsp" %> + org.lamsfoundation.ld.integration.util.*" errorPage="error.jsp" %> <%@ taglib uri="/bbData" prefix="bbData"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> Index: lams_bb_integration/web/links/monitor.jsp =================================================================== diff -u -r4c14d222d530e7a5b09465392b62bf0f4ba3ceee -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/links/monitor.jsp (.../monitor.jsp) (revision 4c14d222d530e7a5b09465392b62bf0f4ba3ceee) +++ lams_bb_integration/web/links/monitor.jsp (.../monitor.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -13,6 +13,7 @@ blackboard.base.*, blackboard.platform.*, blackboard.platform.plugin.*, + blackboard.platform.persistence.*, org.lamsfoundation.ld.integration.*, org.lamsfoundation.ld.integration.blackboard.*" errorPage="error.jsp" %> <%@ taglib uri="/bbNG" prefix="bbNG"%> @@ -113,7 +114,7 @@ return; } - BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager(); + BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager(); Container bbContainer = bbPm.getContainer(); ContentDbLoader cLoader = (ContentDbLoader) bbPm.getLoader( ContentDbLoader.TYPE ); Index: lams_bb_integration/web/links/monitoring.jsp =================================================================== diff -u -r355d2371b4fbb0a4f1da03c97e5328524d0751e2 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/links/monitoring.jsp (.../monitoring.jsp) (revision 355d2371b4fbb0a4f1da03c97e5328524d0751e2) +++ lams_bb_integration/web/links/monitoring.jsp (.../monitoring.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -14,7 +14,7 @@ blackboard.platform.*, blackboard.platform.plugin.*, org.lamsfoundation.ld.integration.*, - org.lamsfoundation.ld.integration.blackboard.*" errorPage="error.jsp" %> + org.lamsfoundation.ld.integration.util.*" errorPage="error.jsp" %> <%@ taglib uri="/bbNG" prefix="bbNG"%> <%@ taglib uri="/bbData" prefix="bbData"%> Index: lams_bb_integration/web/modules/create.jsp =================================================================== diff -u -r24920e7cf45f3176125b10e466b07a43f761e4c9 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/create.jsp (.../create.jsp) (revision 24920e7cf45f3176125b10e466b07a43f761e4c9) +++ lams_bb_integration/web/modules/create.jsp (.../create.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -16,7 +16,7 @@ <%@ page import="blackboard.platform.plugin.PlugInUtil"%> <%@ page import="blackboard.platform.plugin.PlugInException"%> <%@ page import="org.lamsfoundation.ld.integration.Constants"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsSecurityUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.LamsSecurityUtil"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> Index: lams_bb_integration/web/modules/delete.jsp =================================================================== diff -u -r780957f27df870898ade718ccdacd93d5dfadbd7 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/delete.jsp (.../delete.jsp) (revision 780957f27df870898ade718ccdacd93d5dfadbd7) +++ lams_bb_integration/web/modules/delete.jsp (.../delete.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -30,9 +30,7 @@ <%@ page import="blackboard.persist.PersistenceException" %> <%@ page import="blackboard.persist.gradebook.*" %> <%@ page import="blackboard.data.gradebook.*" %> -<%@ page import="org.lamsfoundation.ld.util.*"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsSecurityUtil"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsPluginUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.*"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> Index: lams_bb_integration/web/modules/learnermonitor.jsp =================================================================== diff -u -r46f6e2a2d8c2b6552718747c373df53efd0cfc42 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/learnermonitor.jsp (.../learnermonitor.jsp) (revision 46f6e2a2d8c2b6552718747c373df53efd0cfc42) +++ lams_bb_integration/web/modules/learnermonitor.jsp (.../learnermonitor.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -27,9 +27,10 @@ <%@ page import="blackboard.base.*"%> <%@ page import="blackboard.platform.*"%> <%@ page import="blackboard.platform.plugin.*"%> +<%@ page import="blackboard.platform.persistence.*"%> <%@ page import="blackboard.portal.servlet.*"%> <%@ page import="blackboard.portal.data.*"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsSecurityUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.*"%> <%@ page import="org.lamsfoundation.ld.integration.dto.LearnerProgressDTO"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> @@ -67,6 +68,8 @@ <% + BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager(); + CourseMembershipDbLoader sessionCourseMembershipLoader = CourseMembershipDbLoader.Default.getInstance(); // Authorise current user for Course Access (automatic redirect) try{ @@ -75,22 +78,21 @@ } catch(PlugInException e) { throw new RuntimeException(e); } + + String strLessonId = request.getParameter("lsid").trim(); + String courseIdParam = request.getParameter("course_id"); - // Get Course ID and Session User ID - BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager(); - String courseIdParam = request.getParameter("course_id"); + // Get Course ID and User ID Id course_id = bbPm.generateId(Course.DATA_TYPE, courseIdParam); - User sessionUser = ctx.getUser(); - Id sessionUserId = sessionUser.getId(); + Id userId = ctx.getUser().getId(); // Get the membership data to determine the User's Role CourseMembership courseMembership = null; CourseMembership.Role courseRole = null; boolean isActive = false; - CourseMembershipDbLoader sessionCourseMembershipLoader = (CourseMembershipDbLoader) bbPm.getLoader(CourseMembershipDbLoader.TYPE); try { - courseMembership = sessionCourseMembershipLoader.loadByCourseAndUserId(course_id, sessionUserId); + courseMembership = sessionCourseMembershipLoader.loadByCourseAndUserId(course_id, userId); courseRole = courseMembership.getRole(); isActive = courseMembership.getIsAvailable(); } catch (KeyNotFoundException e) { @@ -134,10 +136,8 @@ description = courseDoc.getBody().getFormattedText(); position = String.valueOf(courseDoc.getPosition()); - //get lineitemid from the storage (bbContentId -> lineitemid) - PortalExtraInfo pei = PortalUtil.loadPortalExtraInfo(null, null, "LamsLineitemStorage"); - ExtraInfo ei = pei.getExtraInfo(); - strLineitemId = ei.getValue(contentIdParam); + //get lineitemid from the storage + Lineitem lineitem = LineitemUtil.getLineitem(contentIdParam, userId, strLessonId); } else { @@ -154,7 +154,8 @@ String strLearningDesignId = request.getParameter("ldid").trim(); long learningDesignId = Long.parseLong(strLearningDesignId); - learningDesignImageUrl = LamsSecurityUtil.generateRequestLearningDesignImage(ctx, false) + "&ldId=" + String username = ctx.getUser().getUserName(); + learningDesignImageUrl = LamsSecurityUtil.generateRequestLearningDesignImage(username, false) + "&ldId=" + learningDesignId; } @@ -183,8 +184,8 @@ } } boolean isScoreAvailable = (current_score != null); - - String strLessonId = request.getParameter("lsid").trim(); + + //prepare learnerProgressDto for displaying on jsp long lessonId = Long.parseLong(strLessonId); LearnerProgressDTO learnerProgressDto = LamsSecurityUtil.getLearnerProgress(ctx, lessonId); %> Index: lams_bb_integration/web/modules/modify.jsp =================================================================== diff -u -re375c54beafdf9b4b7bebf3fe83629f26b8c4626 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/modify.jsp (.../modify.jsp) (revision e375c54beafdf9b4b7bebf3fe83629f26b8c4626) +++ lams_bb_integration/web/modules/modify.jsp (.../modify.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -26,6 +26,7 @@ <%@ page import="blackboard.db.*"%> <%@ page import="blackboard.base.*"%> <%@ page import="blackboard.platform.*"%> +<%@ page import="blackboard.platform.persistence.*"%> <%@ page import="blackboard.platform.plugin.*"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> @@ -43,7 +44,7 @@ } // Get the Course Document (Lams Lesson) - BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager(); + BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager(); Container bbContainer = bbPm.getContainer(); Id contentId = new PkId( bbContainer, CourseDocument.DATA_TYPE, request.getParameter("content_id") ); ContentDbLoader courseDocumentLoader = (ContentDbLoader) bbPm.getLoader( ContentDbLoader.TYPE ); Index: lams_bb_integration/web/modules/modify_proc.jsp =================================================================== diff -u -r9e9be1ef919c14991af369320b686a5e55ed044d -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/modify_proc.jsp (.../modify_proc.jsp) (revision 9e9be1ef919c14991af369320b686a5e55ed044d) +++ lams_bb_integration/web/modules/modify_proc.jsp (.../modify_proc.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -27,8 +27,9 @@ <%@ page import="blackboard.platform.persistence.*"%> <%@ page import="blackboard.platform.plugin.*"%> <%@ page import="blackboard.platform.plugin.*"%> +<%@ page import="blackboard.platform.persistence.*"%> <%@ page import="blackboard.data.gradebook.*"%> -<%@ page import="org.lamsfoundation.ld.util.*"%> +<%@ page import="org.lamsfoundation.ld.integration.util.*"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> @@ -46,7 +47,7 @@ String contentIdStr = request.getParameter("content_id"); // Retrieve the Db persistence manager from the persistence service - BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager(); + BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager(); Container bbContainer = bbPm.getContainer(); // Internal Blackboard IDs for the course and parent content item @@ -83,7 +84,9 @@ //if teacher turned Gradecenter option ON (and it was OFF previously) - create lineitem if (!bbContent.getIsDescribed() && isGradecenter) { - LineitemUtil.createLineitem(ctx, bbContent); + + String username = ctx.getUser().getUserName(); + LineitemUtil.createLineitem(bbContent, ctx, username); //if teacher turned Gradecenter option OFF (and it was ON previously) - remove lineitem } else if (bbContent.getIsDescribed() && !isGradecenter) { Index: lams_bb_integration/web/modules/openAuthor.jsp =================================================================== diff -u -r2eb92be1cecc23f8e94b9d3cabc8340c278bf9a4 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/openAuthor.jsp (.../openAuthor.jsp) (revision 2eb92be1cecc23f8e94b9d3cabc8340c278bf9a4) +++ lams_bb_integration/web/modules/openAuthor.jsp (.../openAuthor.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -1,7 +1,7 @@ <%@ page import="blackboard.platform.plugin.PlugInUtil"%> <%@ page import="blackboard.platform.plugin.PlugInException"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsSecurityUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.LamsSecurityUtil"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> Index: lams_bb_integration/web/modules/openLearner.jsp =================================================================== diff -u -rf069d15896532efad71f60ce4ca74c619a7e3af5 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/openLearner.jsp (.../openLearner.jsp) (revision f069d15896532efad71f60ce4ca74c619a7e3af5) +++ lams_bb_integration/web/modules/openLearner.jsp (.../openLearner.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -15,10 +15,11 @@ <%@ page import="blackboard.db.*"%> <%@ page import="blackboard.base.*"%> <%@ page import="blackboard.platform.*"%> +<%@ page import="blackboard.platform.persistence.*"%> <%@ page import="blackboard.platform.plugin.*"%> <%@ page import="blackboard.portal.servlet.*"%> <%@ page import="blackboard.portal.data.*"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsSecurityUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.LamsSecurityUtil"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> @@ -33,7 +34,7 @@ } // Get Course ID and Session User ID - BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager(); + BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager(); String course_idstr = request.getParameter("course_id"); Id course_id = bbPm.generateId(Course.DATA_TYPE, course_idstr); User sessionUser = ctx.getUser(); Index: lams_bb_integration/web/modules/openMonitor.jsp =================================================================== diff -u -rf069d15896532efad71f60ce4ca74c619a7e3af5 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/openMonitor.jsp (.../openMonitor.jsp) (revision f069d15896532efad71f60ce4ca74c619a7e3af5) +++ lams_bb_integration/web/modules/openMonitor.jsp (.../openMonitor.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -15,10 +15,11 @@ <%@ page import="blackboard.db.*"%> <%@ page import="blackboard.base.*"%> <%@ page import="blackboard.platform.*"%> +<%@ page import="blackboard.platform.persistence.*"%> <%@ page import="blackboard.platform.plugin.*"%> <%@ page import="blackboard.portal.servlet.*"%> <%@ page import="blackboard.portal.data.*"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsSecurityUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.LamsSecurityUtil"%> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> Index: lams_bb_integration/web/modules/preview.jsp =================================================================== diff -u -r355d2371b4fbb0a4f1da03c97e5328524d0751e2 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/preview.jsp (.../preview.jsp) (revision 355d2371b4fbb0a4f1da03c97e5328524d0751e2) +++ lams_bb_integration/web/modules/preview.jsp (.../preview.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -32,8 +32,8 @@ <%@ page import="blackboard.platform.plugin.PlugInException"%> <%@ page import="blackboard.data.gradebook.Lineitem" %> <%@ page import="blackboard.persist.gradebook.LineitemDbPersister" %> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsSecurityUtil"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsPluginUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.LamsSecurityUtil"%> +<%@ page import="org.lamsfoundation.ld.integration.util.LamsPluginUtil"%> <%@ page import="org.lamsfoundation.ld.integration.Constants" %> <%@ page errorPage="/error.jsp"%> <%@ taglib uri="/bbNG" prefix="bbNG"%> Index: lams_bb_integration/web/modules/start_lesson_proc.jsp =================================================================== diff -u -r7d945ecdc0463c75a58f16251e203068bb2e8149 -r92f0489cd46a28a50c81548f165c4d2b4ad10252 --- lams_bb_integration/web/modules/start_lesson_proc.jsp (.../start_lesson_proc.jsp) (revision 7d945ecdc0463c75a58f16251e203068bb2e8149) +++ lams_bb_integration/web/modules/start_lesson_proc.jsp (.../start_lesson_proc.jsp) (revision 92f0489cd46a28a50c81548f165c4d2b4ad10252) @@ -28,15 +28,14 @@ <%@ page import="blackboard.persist.gradebook.ext.*"%> <%@ page import="blackboard.persist.gradebook.impl.*"%> <%@ page import="blackboard.platform.*"%> +<%@ page import="blackboard.platform.persistence.*"%> <%@ page import="blackboard.platform.plugin.PlugInUtil"%> <%@ page import="blackboard.platform.plugin.PlugInException"%> <%@ page import="blackboard.platform.context.Context"%> <%@ page import="blackboard.data.gradebook.Lineitem" %> <%@ page import="blackboard.persist.gradebook.LineitemDbPersister" %> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsSecurityUtil"%> -<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsPluginUtil"%> <%@ page import="org.lamsfoundation.ld.integration.Constants" %> -<%@ page import="org.lamsfoundation.ld.util.*"%> +<%@ page import="org.lamsfoundation.ld.integration.util.*"%> <%@ page import="blackboard.portal.data.*" %> <%@ page import="blackboard.data.content.ExternalLink" %> <%@ page import="blackboard.portal.servlet.PortalUtil" %> @@ -170,15 +169,16 @@ bbContent.setUrl(contentUrl); persister.persist(bbContent); - //store internalContentId -> externalContentId. It's used for lineitem removal (delete.jsp) + //store internalContentId -> externalContentId. It's used for GradebookServlet PortalExtraInfo pei = PortalUtil.loadPortalExtraInfo(null, null, "LamsStorage"); ExtraInfo ei = pei.getExtraInfo(); ei.setValue(bbContentId, lamsLessonId); PortalUtil.savePortalExtraInfo(pei); //Create new Gradebook column for current lesson if (isGradecenter) { - LineitemUtil.createLineitem(ctx, bbContent); + String userName = ctx.getUser().getUserName(); + LineitemUtil.createLineitem(bbContent, ctx, userName); } String strReturnUrl = PlugInUtil.getEditableContentReturnURL(bbContent.getParentId(), courseId);