Index: lams_bb_integration/RELEASE_NOTES.TXT
===================================================================
diff -u -r2847bf67c95146d33cb3573618fb36fe0de142e8 -r2df41e4250f5329a8be4e9e2642d17b091a11f64
--- lams_bb_integration/RELEASE_NOTES.TXT (.../RELEASE_NOTES.TXT) (revision 2847bf67c95146d33cb3573618fb36fe0de142e8)
+++ lams_bb_integration/RELEASE_NOTES.TXT (.../RELEASE_NOTES.TXT) (revision 2df41e4250f5329a8be4e9e2642d17b091a11f64)
@@ -131,3 +131,5 @@
* LDEV-3905: Fixed exception that was thrown on trying to start a lesson while folder selected
* LDEV-3939: Grade center column now gets created on course copy/import; Refactoring of Java code; All util classes moved to org.lamsfoundation.ld.integration.util package
* LDEV-3927: Fixed a FF bug: "Open Lesson" not open in firefox browser for the second time after closing the opened window
+* LDEV-3510: Remove previously added line that made LAMS Lessons always appear at top of content list
+* LDEV-3958: Add a button to admin page that can fix grade center columns
Index: lams_bb_integration/WEB-INF/web.xml
===================================================================
diff -u -rb4a4a2a44c27e0307086d3405993f9febe39f13b -r2df41e4250f5329a8be4e9e2642d17b091a11f64
--- lams_bb_integration/WEB-INF/web.xml (.../web.xml) (revision b4a4a2a44c27e0307086d3405993f9febe39f13b)
+++ lams_bb_integration/WEB-INF/web.xml (.../web.xml) (revision 2df41e4250f5329a8be4e9e2642d17b091a11f64)
@@ -30,6 +30,10 @@
org.lamsfoundation.ld.integration.blackboard.ImportLessonsServlet
+ CorrectLineitemsServlet
+ org.lamsfoundation.ld.integration.blackboard.CorrectLineitemsServlet
+
+
GradebookServlet
org.lamsfoundation.ld.integration.blackboard.GradebookServlet
@@ -71,6 +75,10 @@
/ImportLessons
+ CorrectLineitemsServlet
+ /CorrectLineitems
+
+
GroupDataServlet
/GroupData
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/CloneLessonsServlet.java
===================================================================
diff -u -r90551510089141ff0f625b92c00ab97ba4e98a26 -r2df41e4250f5329a8be4e9e2642d17b091a11f64
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/CloneLessonsServlet.java (.../CloneLessonsServlet.java) (revision 90551510089141ff0f625b92c00ab97ba4e98a26)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/CloneLessonsServlet.java (.../CloneLessonsServlet.java) (revision 2df41e4250f5329a8be4e9e2642d17b091a11f64)
@@ -32,28 +32,24 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
+import org.lamsfoundation.ld.integration.util.BlackboardUtil;
import org.lamsfoundation.ld.integration.util.LamsSecurityUtil;
import org.lamsfoundation.ld.integration.util.LineitemUtil;
import blackboard.base.BbList;
import blackboard.data.content.Content;
import blackboard.data.course.Course;
-import blackboard.data.course.CourseMembership;
import blackboard.data.navigation.CourseToc;
import blackboard.data.user.User;
import blackboard.persist.Id;
import blackboard.persist.PkId;
import blackboard.persist.content.ContentDbLoader;
import blackboard.persist.content.ContentDbPersister;
import blackboard.persist.course.CourseDbLoader;
-import blackboard.persist.course.CourseMembershipDbLoader;
import blackboard.persist.navigation.CourseTocDbLoader;
import blackboard.platform.BbServiceManager;
import blackboard.platform.context.Context;
import blackboard.platform.context.ContextManager;
-import blackboard.portal.data.ExtraInfo;
-import blackboard.portal.data.PortalExtraInfo;
-import blackboard.portal.servlet.PortalUtil;
import blackboard.util.StringUtil;
/**
@@ -82,25 +78,8 @@
PkId courseId = (PkId) course.getId();
String _course_id = "_" + courseId.getPk1() + "_" + courseId.getPk2();
- // find the main teacher
- CourseMembershipDbLoader courseMemLoader = CourseMembershipDbLoader.Default.getInstance();
- BbList monitorCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId,
- CourseMembership.Role.INSTRUCTOR, null, true);
- if (monitorCourseMemberships.isEmpty()) {
- BbList teachingAssistantCourseMemberships = courseMemLoader
- .loadByCourseIdAndRole(courseId, CourseMembership.Role.TEACHING_ASSISTANT, null, true);
- monitorCourseMemberships.addAll(teachingAssistantCourseMemberships);
- if (monitorCourseMemberships.isEmpty()) {
- BbList courseBuilderCourseMemberships = courseMemLoader
- .loadByCourseIdAndRole(courseId, CourseMembership.Role.COURSE_BUILDER, null, true);
- monitorCourseMemberships.addAll(courseBuilderCourseMemberships);
- }
- }
- // validate teacher existence
- if (monitorCourseMemberships.isEmpty()) {
- throw new RuntimeException("There are no monitors in the course courseId=" + courseId);
- }
- User teacher = monitorCourseMemberships.get(0).getUser();
+ // find a teacher that will be assigned as lesson's author on LAMS side
+ User teacher = BlackboardUtil.getCourseTeacher(courseId);
logger.debug("Starting clonning course lessons (courseId=" + courseId + ").");
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/CorrectLineitemsServlet.java
===================================================================
diff -u
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/CorrectLineitemsServlet.java (revision 0)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/CorrectLineitemsServlet.java (revision 2df41e4250f5329a8be4e9e2642d17b091a11f64)
@@ -0,0 +1,189 @@
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+
+package org.lamsfoundation.ld.integration.blackboard;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.lamsfoundation.ld.integration.util.BlackboardUtil;
+import org.lamsfoundation.ld.integration.util.LamsSecurityUtil;
+import org.lamsfoundation.ld.integration.util.LineitemUtil;
+
+import blackboard.base.BbList;
+import blackboard.data.content.Content;
+import blackboard.data.course.Course;
+import blackboard.data.course.CourseMembership;
+import blackboard.data.navigation.CourseToc;
+import blackboard.data.user.User;
+import blackboard.persist.Id;
+import blackboard.persist.PkId;
+import blackboard.persist.content.ContentDbLoader;
+import blackboard.persist.content.ContentDbPersister;
+import blackboard.persist.course.CourseDbLoader;
+import blackboard.persist.course.CourseMembershipDbLoader;
+import blackboard.persist.navigation.CourseTocDbLoader;
+import blackboard.platform.BbServiceManager;
+import blackboard.platform.context.Context;
+import blackboard.platform.context.ContextManager;
+import blackboard.util.StringUtil;
+
+/**
+ * Admin on BB side calls this servlet to correct lineitems that have been screwed up while copying/importing courses.
+ */
+public class CorrectLineitemsServlet extends HttpServlet {
+
+ private static final long serialVersionUID = -3284220455069633836L;
+ private static Logger logger = Logger.getLogger(CorrectLineitemsServlet.class);
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+
+ String courseIdParam = request.getParameter("courseId");
+ if (StringUtil.isEmpty(courseIdParam)) {
+ throw new RuntimeException("Required parameters are missing. courseId: " + courseIdParam);
+ }
+
+ try {
+ // get Blackboard context
+ ContextManager ctxMgr = (ContextManager) BbServiceManager.lookupService(ContextManager.class);
+ Context ctx = ctxMgr.setContext(request);
+
+ CourseDbLoader courseLoader = CourseDbLoader.Default.getInstance();
+ Course course = courseLoader.loadByCourseId(courseIdParam);
+ PkId courseId = (PkId) course.getId();
+ String _course_id = "_" + courseId.getPk1() + "_" + courseId.getPk2();
+
+ // find a teacher that will be assigned as lesson's author on LAMS side
+ User teacher = BlackboardUtil.getCourseTeacher(courseId);
+
+ logger.debug("Starting clonning course lessons (courseId=" + courseId + ").");
+
+ ContentDbLoader contentLoader = ContentDbLoader.Default.getInstance();
+ CourseTocDbLoader cTocDbLoader = CourseTocDbLoader.Default.getInstance();
+
+ //find all lessons that should be updated
+
+ // 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);
+
+ // iterate through the course TOC items
+ for (CourseToc courseToc : courseTocs) {
+
+ // determine if the TOC item is of type "CONTENT" rather than applicaton, or something else
+ if ((courseToc.getTargetType() == CourseToc.Target.CONTENT)
+ && (courseToc.getContentId() != Id.UNSET_ID)) {
+ // 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());
+ // iterate through the content items in this content object
+ for (Content content : contents) {
+ // only LAMS content
+ if ("resource/x-lams-lamscontent".equals(content.getContentHandler())) {
+
+ // update lesson id
+ String lessonId = content.getLinkRef();
+
+ //update lineitem details
+ LineitemUtil.updateLineitemLessonId(content, _course_id, Long.parseLong(lessonId), ctx,
+ teacher.getUserName());
+ }
+
+ }
+ }
+ }
+
+ } catch (IllegalStateException e) {
+ throw new ServletException(
+ "LAMS Server timeout, did not get a response from the LAMS server. Please contact your systems administrator",
+ e);
+ } catch (Exception e) {
+ throw new ServletException(e);
+ }
+
+ //prepare string to write out
+ String resultStr = "Complete! All lineiems have been corrected.";
+ logger.debug(resultStr);
+
+ response.setContentType("text/html");
+ PrintWriter out = response.getWriter();
+ out.write(resultStr);
+ out.flush();
+ out.close();
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ doGet(req, resp);
+ }
+
+ /*
+ * Returns param value, and empty string in case of there is no such param available
+ *
+ * @param url
+ * @param paramName
+ * @return
+ */
+ private static String getParameterValue(String url, String paramName) {
+ String paramValue = "";
+
+ int quotationMarkIndex = url.indexOf("?");
+ String queryPart = quotationMarkIndex > -1 ? url.substring(quotationMarkIndex + 1) : url;
+ String[] paramEntries = queryPart.split("&");
+ for (String paramEntry : paramEntries) {
+ String[] paramEntrySplitted = paramEntry.split("=");
+ if ((paramEntrySplitted.length > 1) && paramName.equalsIgnoreCase(paramEntrySplitted[0])) {
+ paramValue = paramEntrySplitted[1];
+ break;
+ }
+ }
+
+ return paramValue;
+ }
+
+ private static String replaceParameterValue(String url, String paramName, String newParamValue) {
+ String oldParamValue = "";
+
+ int quotationMarkIndex = url.indexOf("?");
+ String queryPart = quotationMarkIndex > -1 ? url.substring(quotationMarkIndex + 1) : url;
+ String[] paramEntries = queryPart.split("&");
+ for (String paramEntry : paramEntries) {
+ String[] paramEntrySplitted = paramEntry.split("=");
+ if ((paramEntrySplitted.length > 1) && paramName.equalsIgnoreCase(paramEntrySplitted[0])) {
+ oldParamValue = paramEntrySplitted[1];
+
+ return url.replaceFirst(paramName + "=" + oldParamValue, paramName + "=" + newParamValue);
+ }
+ }
+
+ return url;
+ }
+
+}
\ No newline at end of file
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/ImportLessonsServlet.java
===================================================================
diff -u -r90551510089141ff0f625b92c00ab97ba4e98a26 -r2df41e4250f5329a8be4e9e2642d17b091a11f64
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/ImportLessonsServlet.java (.../ImportLessonsServlet.java) (revision 90551510089141ff0f625b92c00ab97ba4e98a26)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/ImportLessonsServlet.java (.../ImportLessonsServlet.java) (revision 2df41e4250f5329a8be4e9e2642d17b091a11f64)
@@ -33,6 +33,7 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
+import org.lamsfoundation.ld.integration.util.BlackboardUtil;
import org.lamsfoundation.ld.integration.util.LamsSecurityUtil;
import org.lamsfoundation.ld.integration.util.LamsServerException;
import org.lamsfoundation.ld.integration.util.LineitemUtil;
@@ -87,25 +88,8 @@
PkId courseId = (PkId) course.getId();
String _course_id = "_" + courseId.getPk1() + "_" + courseId.getPk2();
- // find the main teacher
- CourseMembershipDbLoader courseMemLoader = CourseMembershipDbLoader.Default.getInstance();
- BbList monitorCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId,
- CourseMembership.Role.INSTRUCTOR, null, true);
- if (monitorCourseMemberships.isEmpty()) {
- BbList teachingAssistantCourseMemberships = courseMemLoader
- .loadByCourseIdAndRole(courseId, CourseMembership.Role.TEACHING_ASSISTANT, null, true);
- monitorCourseMemberships.addAll(teachingAssistantCourseMemberships);
- if (monitorCourseMemberships.isEmpty()) {
- BbList courseBuilderCourseMemberships = courseMemLoader
- .loadByCourseIdAndRole(courseId, CourseMembership.Role.COURSE_BUILDER, null, true);
- monitorCourseMemberships.addAll(courseBuilderCourseMemberships);
- }
- }
- // validate teacher existence
- if (monitorCourseMemberships.isEmpty()) {
- throw new RuntimeException("There are no monitors in the course courseId=" + courseId);
- }
- User teacher = monitorCourseMemberships.get(0).getUser();
+ // find a teacher that will be assigned as lesson's author on LAMS side
+ User teacher = BlackboardUtil.getCourseTeacher(courseId);
logger.debug("Starting importing course lessons (courseId=" + courseId + ").");
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/util/BlackboardUtil.java
===================================================================
diff -u
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/util/BlackboardUtil.java (revision 0)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/util/BlackboardUtil.java (revision 2df41e4250f5329a8be4e9e2642d17b091a11f64)
@@ -0,0 +1,49 @@
+package org.lamsfoundation.ld.integration.util;
+
+import blackboard.base.BbList;
+import blackboard.data.course.CourseMembership;
+import blackboard.data.user.User;
+import blackboard.persist.PersistenceException;
+import blackboard.persist.PkId;
+import blackboard.persist.course.CourseMembershipDbLoader;
+
+/**
+ * Set of utilities dealing with Blackboard data.
+ *
+ * @author Andrey Balan
+ */
+public class BlackboardUtil {
+
+ /**
+ * Returns some random teacher from the specified course.
+ *
+ * @param courseId
+ * BB course id
+ * @return teacher
+ * @throws PersistenceException
+ */
+ public static User getCourseTeacher(PkId courseId) throws PersistenceException {
+ // find the main teacher
+ CourseMembershipDbLoader courseMemLoader = CourseMembershipDbLoader.Default.getInstance();
+ BbList monitorCourseMemberships = courseMemLoader.loadByCourseIdAndRole(courseId,
+ CourseMembership.Role.INSTRUCTOR, null, true);
+ if (monitorCourseMemberships.isEmpty()) {
+ BbList teachingAssistantCourseMemberships = courseMemLoader
+ .loadByCourseIdAndRole(courseId, CourseMembership.Role.TEACHING_ASSISTANT, null, true);
+ monitorCourseMemberships.addAll(teachingAssistantCourseMemberships);
+ if (monitorCourseMemberships.isEmpty()) {
+ BbList courseBuilderCourseMemberships = courseMemLoader
+ .loadByCourseIdAndRole(courseId, CourseMembership.Role.COURSE_BUILDER, null, true);
+ monitorCourseMemberships.addAll(courseBuilderCourseMemberships);
+ }
+ }
+ // validate teacher existence
+ if (monitorCourseMemberships.isEmpty()) {
+ throw new RuntimeException("There are no monitors in the course courseId=" + courseId);
+ }
+ User teacher = monitorCourseMemberships.get(0).getUser();
+
+ return teacher;
+ }
+
+}
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LamsSecurityUtil.java
===================================================================
diff -u -r90551510089141ff0f625b92c00ab97ba4e98a26 -r2df41e4250f5329a8be4e9e2642d17b091a11f64
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LamsSecurityUtil.java (.../LamsSecurityUtil.java) (revision 90551510089141ff0f625b92c00ab97ba4e98a26)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/util/LamsSecurityUtil.java (.../LamsSecurityUtil.java) (revision 2df41e4250f5329a8be4e9e2642d17b091a11f64)
@@ -22,7 +22,6 @@
*/
package org.lamsfoundation.ld.integration.util;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
@@ -37,7 +36,6 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
-import java.util.Properties;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -60,9 +58,7 @@
import blackboard.persist.PersistenceException;
import blackboard.persist.course.CourseMembershipDbLoader;
import blackboard.persist.user.UserDbLoader;
-import blackboard.platform.BbServiceManager;
import blackboard.platform.context.Context;
-import blackboard.platform.cx.component.CopyControl;
import blackboard.platform.persistence.PersistenceServiceFactory;
import blackboard.portal.data.ExtraInfo;
import blackboard.portal.data.PortalExtraInfo;
@@ -78,24 +74,6 @@
private static Logger logger = Logger.getLogger(LamsSecurityUtil.class);
private static final String DUMMY_COURSE = "Previews";
private static final String EXPORT_FOLDER_LAMS_SERVER = "/tmp/lams/";
-
- /**
- * Generates login requests to LAMS for author, monitor and learner, using the alternative URL.
- *
- * @param ctx
- * the blackboard contect, contains session data
- * @param method
- * the mehtod to request of LAMS "author", "monitor", "learnerStrictAuth"
- * @param lsid
- * lesson id. It is expected to be present in case of "monitor" and "learnerStrictAuth"
- * @return a url pointing to the LAMS lesson, monitor, author session
- * @throws IOException
- * @throws PersistenceException
- * @throws Exception
- */
- public static String generateRequestAltURL(Context ctx, String method, String lsid) throws PersistenceException, IOException {
- return generateRequestURLForServer(ctx, method, lsid, getAltServerAddress());
- }
/**
* Generates login requests to LAMS for author, monitor and learner
@@ -112,10 +90,7 @@
* @throws Exception
*/
public static String generateRequestURL(Context ctx, String method, String lsid) throws PersistenceException, IOException {
- return generateRequestURLForServer(ctx, method, lsid, getServerAddress());
- }
-
- private static String generateRequestURLForServer(Context ctx, String method, String lsid, String serverAddr) throws PersistenceException, IOException {
+ String serverAddr = getServerAddress();
String serverId = getServerID();
String reqSrc = getReqSrc();
@@ -268,7 +243,7 @@
User user = ctx.getUser();
if ( user == null )
- user = loadUserFromDB(ctx, usernameFromParam);
+ user = loadUserFromDB(usernameFromParam);
String username = user.getUserName();
String firstName = user.getGivenName();
@@ -352,18 +327,18 @@
return learningDesigns;
}
- private static User loadUserFromDB(Context ctx, String username) {
+ private static User loadUserFromDB(String username) {
User user = null;
try {
final UserDbLoader userDbLoader = UserDbLoader.Default.getInstance();
user = userDbLoader.loadByUserName(username);
} catch (KeyNotFoundException e) {
- throw new RuntimeException("No user details found in context or via username parameter. Unable access LAMS. "+e.getMessage()+" Username "+username+" Ctx "+ctx,e);
+ throw new RuntimeException("No user details found in context or via username parameter. Unable access LAMS. "+e.getMessage()+" Username "+username,e);
} catch (PersistenceException e) {
- throw new RuntimeException("No user details found in context or via username parameter. Unable access LAMS. "+e.getMessage()+" Username "+username+" Ctx "+ctx,e);
+ throw new RuntimeException("No user details found in context or via username parameter. Unable access LAMS. "+e.getMessage()+" Username "+username,e);
}
if ( user == null ) {
- throw new RuntimeException("No user details found in context or via username parameter. Unable access LAMS. Username "+username+" Ctx "+ctx);
+ throw new RuntimeException("No user details found in context or via username parameter. Unable access LAMS. Username "+username);
}
return user;
}
@@ -439,12 +414,15 @@
private static String setupCourseId(Context ctx, String urlCourseId, boolean allowUserDummyCourse) {
// can we pull the alphanumeric course id from the context, rather than the on passed in from the URL? If neither exist, use the dummy Preview course.
String courseId = null;
- if ( ctx.getCourse()!=null )
+ if (ctx.getCourse() != null) {
courseId = ctx.getCourse().getCourseId();
- if ( courseId == null && urlCourseId != null && urlCourseId.length() > 0)
+ }
+ if (courseId == null && urlCourseId != null && urlCourseId.length() > 0) {
courseId = urlCourseId;
- if ( courseId == null && allowUserDummyCourse )
+ }
+ if (courseId == null && allowUserDummyCourse) {
courseId = DUMMY_COURSE;
+ }
return courseId;
}
/**
@@ -492,7 +470,7 @@
User user = ctx.getUser();
if ( user == null )
- user = loadUserFromDB(ctx, usernameFromParam);
+ user = loadUserFromDB(usernameFromParam);
String username = user.getUserName();
String locale = user.getLocale();
@@ -1069,41 +1047,7 @@
return "" + lamsServerTime;
}
-
- /**
- * Gets the app.version property value from
- * the ./main.properties file of the base folder
- *
- * @return app.version string
- * @throws IOException
- */
- public static String getAppVersion() throws IOException{
- String versionString = null;
-
- //to load application's properties, we use this class
- Properties mainProperties = new Properties();
-
- FileInputStream file;
-
- //the base folder is ./, the root of the main.properties file
- String path = "./main.properties";
-
- //load the file handle for main.properties
- file = new FileInputStream(path);
-
- //load all the properties from this file
- mainProperties.load(file);
-
- //we have loaded the properties, so close the file handle
- file.close();
-
- //retrieve the property we are intrested, the app.version
- versionString = mainProperties.getProperty("app.version");
-
- return versionString;
- }
-
/**
* @return gets server address from the lams.properties file
*/
@@ -1114,7 +1058,7 @@
/**
* @return gets alternative server address from the lams.properties file
*/
- public static String getAltServerAddress() {
+ private static String getAltServerAddress() {
return LamsPluginUtil.getProperties().getProperty(LamsPluginUtil.PROP_ALT_LAMS_URL);
}
@@ -1129,22 +1073,22 @@
/**
* @return gets server key from the lams.properties file
*/
- public static String getServerKey() {
+ private static String getServerKey() {
return LamsPluginUtil.getProperties().getProperty(LamsPluginUtil.PROP_LAMS_SECRET_KEY);
}
/**
* @return gets request source from the lams.properties file
*/
- public static String getReqSrc() {
+ private static String getReqSrc() {
return LamsPluginUtil.getProperties().getProperty(LamsPluginUtil.PROP_REQ_SRC);
}
/**
*
* @return the LAMS server time refresh interval from lams.properties
*/
- public static long getLamsServerTimeRefreshInterval() {
+ private static long getLamsServerTimeRefreshInterval() {
//set default value
long lamsServerTimeRefreshInterval = 24;
@@ -1160,7 +1104,7 @@
}
// generate authentication hash code to validate parameters
- public static String generateAuthenticationHash(String datetime, String login, String serverId) {
+ private static String generateAuthenticationHash(String datetime, String login, String serverId) {
String secretkey = getServerKey();
String plaintext = datetime.toLowerCase().trim() + login.toLowerCase().trim() + serverId.toLowerCase().trim()
Index: lams_bb_integration/web/links/admin.jsp
===================================================================
diff -u -rb4a4a2a44c27e0307086d3405993f9febe39f13b -r2df41e4250f5329a8be4e9e2642d17b091a11f64
--- lams_bb_integration/web/links/admin.jsp (.../admin.jsp) (revision b4a4a2a44c27e0307086d3405993f9febe39f13b)
+++ lams_bb_integration/web/links/admin.jsp (.../admin.jsp) (revision 2df41e4250f5329a8be4e9e2642d17b091a11f64)
@@ -54,6 +54,11 @@
+
+
+
@@ -66,7 +71,7 @@
// Open the LAMS Seuence Monitor Window
function cloneLessons() {
//block #buttons
- blockButtons();
+ blockButtons('Please, wait. Lessons are getting copied now.
');
$j.ajax({
async: true,
@@ -90,7 +95,7 @@
function importLessons() {
//block #buttons
- blockButtons();
+ blockButtons('Please, wait. Lessons are getting copied now.
');
$j.ajax({
async: true,
@@ -110,11 +115,33 @@
return false;
}
+ function correctLineitems() {
+ //block #buttons
+ blockButtons('Please wait while Grade center columns are getting fixed.
');
+
+ $j.ajax({
+ async: true,
+ url: '../CorrectLineitems',
+ data : 'courseId=<%=ctx.getCourse().getCourseId()%>',
+ type: 'post',
+ success: function (response) {
+ $j("#buttons").unblock();
+ alert(response);
+ },
+ error: function (request, status, error) {
+ $j("#buttons").unblock();
+ alert(error);
+ }
+ });
+
+ return false;
+ }
+
//auxiliary method to block #buttons element
- function blockButtons(){
+ function blockButtons(message){
$j('#buttons').block({
- message: 'Please, wait. Lessons are getting copied now.
',
+ message: message,
baseZ: 1000000,
fadeIn: 0,
css: {