Index: lams_bb_integration/web/admin/config.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/admin/config.jsp,v diff -u -r1.6 -r1.7 --- lams_bb_integration/web/admin/config.jsp 29 Jul 2015 10:44:31 -0000 1.6 +++ lams_bb_integration/web/admin/config.jsp 4 Aug 2016 16:49:07 -0000 1.7 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/admin/Attic/config_proc.jsp,v diff -u -r1.4 -r1.5 --- lams_bb_integration/web/admin/config_proc.jsp 29 Jul 2015 10:44:31 -0000 1.4 +++ lams_bb_integration/web/admin/config_proc.jsp 4 Aug 2016 16:49:07 -0000 1.5 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/links/author.jsp,v diff -u -r1.1 -r1.2 --- lams_bb_integration/web/links/author.jsp 23 Dec 2014 10:38:35 -0000 1.1 +++ lams_bb_integration/web/links/author.jsp 4 Aug 2016 16:49:07 -0000 1.2 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/links/monitor.jsp,v diff -u -r1.5 -r1.6 --- lams_bb_integration/web/links/monitor.jsp 23 Jul 2016 06:20:09 -0000 1.5 +++ lams_bb_integration/web/links/monitor.jsp 4 Aug 2016 16:49:07 -0000 1.6 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/links/Attic/monitoring.jsp,v diff -u -r1.1 -r1.2 --- lams_bb_integration/web/links/monitoring.jsp 23 Dec 2014 10:38:35 -0000 1.1 +++ lams_bb_integration/web/links/monitoring.jsp 4 Aug 2016 16:49:07 -0000 1.2 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/create.jsp,v diff -u -r1.20 -r1.21 --- lams_bb_integration/web/modules/create.jsp 23 Jul 2016 17:04:09 -0000 1.20 +++ lams_bb_integration/web/modules/create.jsp 4 Aug 2016 16:49:07 -0000 1.21 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/Attic/delete.jsp,v diff -u -r1.4 -r1.5 --- lams_bb_integration/web/modules/delete.jsp 16 Feb 2014 17:30:09 -0000 1.4 +++ lams_bb_integration/web/modules/delete.jsp 4 Aug 2016 16:49:07 -0000 1.5 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/learnermonitor.jsp,v diff -u -r1.26 -r1.27 --- lams_bb_integration/web/modules/learnermonitor.jsp 5 Jul 2016 11:31:28 -0000 1.26 +++ lams_bb_integration/web/modules/learnermonitor.jsp 4 Aug 2016 16:49:07 -0000 1.27 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/modify.jsp,v diff -u -r1.9 -r1.10 --- lams_bb_integration/web/modules/modify.jsp 10 Aug 2015 04:36:52 -0000 1.9 +++ lams_bb_integration/web/modules/modify.jsp 4 Aug 2016 16:49:07 -0000 1.10 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/Attic/modify_proc.jsp,v diff -u -r1.9 -r1.10 --- lams_bb_integration/web/modules/modify_proc.jsp 18 Feb 2014 14:39:16 -0000 1.9 +++ lams_bb_integration/web/modules/modify_proc.jsp 4 Aug 2016 16:49:07 -0000 1.10 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/Attic/openAuthor.jsp,v diff -u -r1.1 -r1.2 --- lams_bb_integration/web/modules/openAuthor.jsp 5 Dec 2014 22:33:50 -0000 1.1 +++ lams_bb_integration/web/modules/openAuthor.jsp 4 Aug 2016 16:49:07 -0000 1.2 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/Attic/openLearner.jsp,v diff -u -r1.2 -r1.3 --- lams_bb_integration/web/modules/openLearner.jsp 5 May 2015 17:11:26 -0000 1.2 +++ lams_bb_integration/web/modules/openLearner.jsp 4 Aug 2016 16:49:07 -0000 1.3 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/Attic/openMonitor.jsp,v diff -u -r1.2 -r1.3 --- lams_bb_integration/web/modules/openMonitor.jsp 5 May 2015 17:11:26 -0000 1.2 +++ lams_bb_integration/web/modules/openMonitor.jsp 4 Aug 2016 16:49:07 -0000 1.3 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/Attic/preview.jsp,v diff -u -r1.7 -r1.8 --- lams_bb_integration/web/modules/preview.jsp 23 Dec 2014 10:38:35 -0000 1.7 +++ lams_bb_integration/web/modules/preview.jsp 4 Aug 2016 16:49:07 -0000 1.8 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/web/modules/Attic/start_lesson_proc.jsp,v diff -u -r1.17 -r1.18 --- lams_bb_integration/web/modules/start_lesson_proc.jsp 18 Oct 2015 03:21:00 -0000 1.17 +++ lams_bb_integration/web/modules/start_lesson_proc.jsp 4 Aug 2016 16:49:07 -0000 1.18 @@ -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);