Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/GradebookSyncServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/GradebookSyncServlet.java,v diff -u -r1.7 -r1.8 --- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/GradebookSyncServlet.java 21 Apr 2017 20:35:36 -0000 1.7 +++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/GradebookSyncServlet.java 24 Apr 2017 19:39:20 -0000 1.8 @@ -32,6 +32,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; +import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -51,7 +52,6 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import blackboard.base.BbList; import blackboard.base.InitializationException; import blackboard.data.ValidationException; import blackboard.data.course.CourseMembership; @@ -134,8 +134,8 @@ NodeList learnerResults = lesson.getChildNodes(); //in order to reduce DB queries we get scores and courseMemberships all at once - BbList dbScores = scoreLoader.loadByLineitemId(lineitem.getId()); - BbList courseMemberships = courseMemLoader.loadByCourseId(lineitem.getCourseId(), null, true); + List dbScores = scoreLoader.loadByLineitemId(lineitem.getId()); + List courseMemberships = courseMemLoader.loadByCourseId(lineitem.getCourseId(), null, true); //update all marks for (CourseMembership courseMembership: courseMemberships) { Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/GroupDataServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/GroupDataServlet.java,v diff -u -r1.4 -r1.5 --- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/GroupDataServlet.java 21 Apr 2017 20:35:36 -0000 1.4 +++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/GroupDataServlet.java 24 Apr 2017 19:39:20 -0000 1.5 @@ -39,7 +39,6 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import blackboard.base.BbList; import blackboard.data.course.Course; import blackboard.data.course.Group; import blackboard.data.user.User; @@ -120,7 +119,7 @@ JsonArray jsonUsers = new JsonArray(); jsonGroup.add("users", jsonUsers); - BbList users = userDbLoader.loadByGroupId(groupId, null, true); + List users = userDbLoader.loadByGroupId(groupId, null, true); for (User user : users) { JsonObject jsonUser = new JsonObject(); jsonUsers.add(jsonUser); Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LinkToolsServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LinkToolsServlet.java,v diff -u -r1.1 -r1.2 --- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LinkToolsServlet.java 21 Apr 2017 20:35:36 -0000 1.1 +++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LinkToolsServlet.java 24 Apr 2017 19:39:20 -0000 1.2 @@ -41,7 +41,6 @@ import org.lamsfoundation.ld.integration.util.LineitemUtil; import org.xml.sax.SAXException; -import blackboard.base.BbList; import blackboard.base.FormattedText; import blackboard.base.InitializationException; import blackboard.data.ValidationException; @@ -142,7 +141,7 @@ CourseTocDbLoader ctLoader = (CourseTocDbLoader) bbPm.getLoader(CourseTocDbLoader.TYPE); Course course = ctx.getCourse(); - BbList ctList = ctLoader.loadByCourseId(courseId); + List ctList = ctLoader.loadByCourseId(courseId); CourseToc[] courseTocs = (CourseToc[]) ctList.toArray(new CourseToc[0]); int idx = 0; @@ -197,7 +196,7 @@ if (f.getIsFolder()) { - BbList cList = cLoader.loadChildren(f.getId()); + List cList = cLoader.loadChildren(f.getId()); Content[] cArray = cList.toArray(new Content[0]); //sort content by title Arrays.sort(cArray, new Comparator() { @@ -345,8 +344,7 @@ List lamsContents = BlackboardUtil.getLamsLessonsByCourse(courseId); for (Content content : lamsContents) { - PkId contentId = (PkId) content.getId(); - String _content_id = "_" + contentId.getPk1() + "_" + contentId.getPk2(); + String _content_id = content.getId().toExternalString(); String url = content.getUrl(); String urlLessonId = getParameterValue(url, "lsid"); @@ -412,8 +410,7 @@ List lamsContents = BlackboardUtil.getLamsLessonsByCourse(courseId); for (Content content : lamsContents) { - PkId contentId = (PkId) content.getId(); - String _content_id = "_" + contentId.getPk1() + "_" + contentId.getPk2(); + String _content_id = content.getId().toExternalString(); String url = content.getUrl(); String urlLessonId = getParameterValue(url, "lsid"); Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/util/BlackboardUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/src/org/lamsfoundation/ld/integration/util/BlackboardUtil.java,v diff -u -r1.9 -r1.10 --- lams_bb_integration/src/org/lamsfoundation/ld/integration/util/BlackboardUtil.java 21 Apr 2017 20:35:36 -0000 1.9 +++ lams_bb_integration/src/org/lamsfoundation/ld/integration/util/BlackboardUtil.java 24 Apr 2017 19:39:20 -0000 1.10 @@ -13,7 +13,6 @@ import org.xml.sax.SAXException; -import blackboard.base.BbList; import blackboard.base.FormattedText; import blackboard.data.ValidationException; import blackboard.data.content.Content; @@ -56,14 +55,14 @@ public static User getCourseTeacher(PkId courseId) throws PersistenceException { // find the main teacher CourseMembershipDbLoader courseMemLoader = CourseMembershipDbLoader.Default.getInstance(); - BbList monitorCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, + List monitorCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, CourseMembership.Role.INSTRUCTOR, null, true); if (monitorCourseMemberships.isEmpty()) { - BbList teachingAssistantCourseMemberships = courseMemLoader + List teachingAssistantCourseMemberships = courseMemLoader .loadByCourseIdAndRole(courseId, CourseMembership.Role.TEACHING_ASSISTANT, null, true); monitorCourseMemberships.addAll(teachingAssistantCourseMemberships); if (monitorCourseMemberships.isEmpty()) { - BbList courseBuilderCourseMemberships = courseMemLoader + List courseBuilderCourseMemberships = courseMemLoader .loadByCourseIdAndRole(courseId, CourseMembership.Role.COURSE_BUILDER, null, true); monitorCourseMemberships.addAll(courseBuilderCourseMemberships); } @@ -92,7 +91,7 @@ // get a CourseTOC (Table of Contents) loader. We will need this to iterate through all of the "areas" // within the course - BbList courseTocs = cTocDbLoader.loadByCourseId(courseId); + List courseTocs = cTocDbLoader.loadByCourseId(courseId); // iterate through the course TOC items List lamsContents = new ArrayList(); @@ -103,7 +102,7 @@ // we have determined that the TOC item is content, next we need to load the content object and // iterate through it // load the content tree into an object "content" and iterate through it - BbList contents = contentLoader.loadListById(courseToc.getContentId()); + List contents = contentLoader.loadListById(courseToc.getContentId()); // iterate through the content items in this content object for (Content content : contents) { // only LAMS content @@ -201,7 +200,7 @@ bbContent.setBody(description); // assign LAMS lesson the last position number so it appears at the bottom of the list - BbList contents = contentLoader.loadListById(folderId); + List contents = contentLoader.loadListById(folderId); int countContentsInsideFolder = contents.size(); bbContent.setPosition(countContentsInsideFolder); @@ -224,8 +223,8 @@ // Persist the New Lesson Object in Blackboard ContentDbPersister persister = (ContentDbPersister) bbPm.getPersister(ContentDbPersister.TYPE); persister.persist(bbContent); - PkId bbContentPkId = (PkId) bbContent.getId(); - String bbContentId = "_" + bbContentPkId.getPk1() + "_" + bbContentPkId.getPk2(); + //same as "_" + bbContent.getId().getPk1() + "_" + bbContent.getId().getPk2() + String bbContentId = bbContent.getId().toExternalString(); // Build and set the content URL. Include new lesson id parameter int bbport = request.getServerPort();// Add port to the url if the port is in the blackboard url. Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/util/CSVUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/src/org/lamsfoundation/ld/integration/util/CSVUtil.java,v diff -u -r1.2 -r1.3 --- lams_bb_integration/src/org/lamsfoundation/ld/integration/util/CSVUtil.java 21 Apr 2017 20:35:36 -0000 1.2 +++ lams_bb_integration/src/org/lamsfoundation/ld/integration/util/CSVUtil.java 24 Apr 2017 19:39:20 -0000 1.3 @@ -127,7 +127,7 @@ * @return */ public static String[] parse(String str) throws ParseException{ - ArrayList res = new ArrayList(); + ArrayList res = new ArrayList(); int startIndex = 0; boolean openQuote = false; Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LamsSecurityUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LamsSecurityUtil.java,v diff -u -r1.8 -r1.9 --- lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LamsSecurityUtil.java 21 Apr 2017 20:35:36 -0000 1.8 +++ lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LamsSecurityUtil.java 24 Apr 2017 19:39:20 -0000 1.9 @@ -36,6 +36,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Date; +import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -51,7 +52,6 @@ import org.w3c.dom.NamedNodeMap; import org.xml.sax.SAXException; -import blackboard.base.BbList; import blackboard.data.course.Course; import blackboard.data.course.CourseMembership; import blackboard.data.user.User; @@ -730,7 +730,7 @@ CourseMembershipDbLoader courseMemLoader = CourseMembershipDbLoader.Default.getInstance(); Id courseId = course.getId(); - BbList studentCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, + List studentCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, CourseMembership.Role.STUDENT, null, true); for (CourseMembership courseMembership : studentCourseMemberships) { String learnerId = escapeValue(courseMembership.getUser().getUserName()); @@ -746,12 +746,12 @@ emails += email + ","; } - BbList monitorCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, + List monitorCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, CourseMembership.Role.INSTRUCTOR, null, true); - BbList teachingAssistantCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, + List teachingAssistantCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, CourseMembership.Role.TEACHING_ASSISTANT, null, true); monitorCourseMemberships.addAll(teachingAssistantCourseMemberships); - BbList courseBuilderCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, + List courseBuilderCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId, CourseMembership.Role.COURSE_BUILDER, null, true); monitorCourseMemberships.addAll(courseBuilderCourseMemberships); for (CourseMembership courseMembership : monitorCourseMemberships) { Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LineitemUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LineitemUtil.java,v diff -u -r1.6 -r1.7 --- lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LineitemUtil.java 2 Feb 2017 13:50:20 -0000 1.6 +++ lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LineitemUtil.java 24 Apr 2017 19:39:20 -0000 1.7 @@ -76,6 +76,7 @@ private static Logger logger = Logger.getLogger(LineitemUtil.class); + @SuppressWarnings("deprecation") public static void createLineitem(Content bbContent, String userName) throws ValidationException, PersistenceException, IOException, ParserConfigurationException, SAXException { LineitemDbPersister linePersister = LineitemDbPersister.Default.getInstance(); @@ -237,8 +238,7 @@ LineitemDbLoader lineitemLoader = LineitemDbLoader.Default.getInstance(); LineitemDbPersister linePersister = LineitemDbPersister.Default.getInstance(); - PkId contentId = (PkId) bbContent.getId(); - String _content_id = "_" + contentId.getPk1() + "_" + contentId.getPk2(); + String _content_id = bbContent.getId().toExternalString(); //update only in case grade center is ON if (bbContent.getIsDescribed()) { @@ -272,17 +272,15 @@ * @throws PersistenceException */ private static void updateLamsLineitemStorage(Content bbContent, Lineitem lineitem) throws PersistenceException { - //Construct bbContent id - PkId bbContentPkId = (PkId) bbContent.getId(); - String bbContentId = "_" + bbContentPkId.getPk1() + "_" + bbContentPkId.getPk2(); - //Construct lineitem id - PkId lineitemPkId = (PkId) lineitem.getId(); - String lineitemId = "_" + lineitemPkId.getPk1() + "_" + lineitemPkId.getPk2(); + //get bbContent id + String _content_id = bbContent.getId().toExternalString(); + //get lineitem id + String _lineitem_id = lineitem.getId().toExternalString(); //Store lineitemid to the storage bbContentId -> lineitemid (this storage is available since 1.2.3 version) PortalExtraInfo pei = PortalUtil.loadPortalExtraInfo(null, null, LAMS_LINEITEM_STORAGE); ExtraInfo ei = pei.getExtraInfo(); - ei.setValue(bbContentId, lineitemId); + ei.setValue(_content_id, _lineitem_id); PortalUtil.savePortalExtraInfo(pei); } @@ -301,10 +299,10 @@ //get lineitemId from the storage (bbContentId -> lineitemId) PortalExtraInfo pei = PortalUtil.loadPortalExtraInfo(null, null, LAMS_LINEITEM_STORAGE); ExtraInfo ei = pei.getExtraInfo(); - String lineitemIdStr = ei.getValue(bbContentId); + String _lineitem_id = ei.getValue(bbContentId); // try to get lineitem from any course that user is participating in (for lineitems created in versions after 1.2 and before 1.2.3) - if (lineitemIdStr == null) { + if (_lineitem_id == null) { // get stored bbContentId -> lamsLessonId PortalExtraInfo portalExtraInfo = PortalUtil.loadPortalExtraInfo(null, null, "LamsStorage"); ExtraInfo extraInfo = portalExtraInfo.getExtraInfo(); @@ -341,16 +339,15 @@ } // delete lineitem (can't delete it simply doing linePersister.deleteById(lineitem.getId()) due to BB9 bug) - PkId lineitemPkId = (PkId) lineitem.getId(); - lineitemIdStr = "_" + lineitemPkId.getPk1() + "_" + lineitemPkId.getPk2(); + _lineitem_id = lineitem.getId().toExternalString(); } - if (lineitemIdStr == null) { + if (_lineitem_id == null) { throw new LamsBuildingBlockException("Lineitem was not found for contentId:" + bbContentId + ". This is despite the fact that isGradecenter option is ON."); } - Id lineitemId = bbPm.generateId(Lineitem.LINEITEM_DATA_TYPE, lineitemIdStr.trim()); + Id lineitemId = bbPm.generateId(Lineitem.LINEITEM_DATA_TYPE, _lineitem_id.trim()); return lineitemId; }