Index: lams_webct_integration/build.properties =================================================================== RCS file: /usr/local/cvsroot/lams_webct_integration/build.properties,v diff -u -r1.5 -r1.6 --- lams_webct_integration/build.properties 8 Jan 2008 02:48:55 -0000 1.5 +++ lams_webct_integration/build.properties 1 Feb 2008 03:13:05 -0000 1.6 @@ -1,53 +1,50 @@ # Build.properties for configuring the LAMS/WebCt integration module - - -# WEBCT SETTINGS + +# WEBCT SETTINGS ############################# - + # Location of WebCt deployablecomponents directory webctDeployableComponentsDir=C:/bea815/weblogic81/config/WebCTDomain/deployablecomponents - + ############################## - - -# DATABASE CONFIGURATION + +# DATABASE CONFIGURATION ############################# - -# The type of database used tested for MsSql and MySql + +# The type of database used, tested for MySql dbType=MySql - + # The host of the database -dbHost=192.168.111.30 - +dbHost=localhost + # The port database is running through dbPort=3306 - -# Database name user and password with permision to webct database -dbName=lams_ldap_2_0_4 + +# Database name, table name, user and password with access from WebCt server +dbName=lams dbTable=webct_lams_lesson dbUser=webct_lams_user -dbPass=webctpass - +dbPass= + ############################# - - - -# SERVER CONFIGURATION (configurable in webct admin) + +# SERVER CONFIGURATION ############################# - + # The URL that points to LAMS, make sure it finishes with a '/' -lamsServerUrl=http://stinger.melcoe.mq.edu.au/lams/ - +lamsServerUrl=http://localhost:8080/lams/ + # Server id serverId=webctlams - + # Secret Key -secretKey=webctlams - -# Resuest source name for your WebCt server -reqSrc=WebCt - -# Url location of image folder containing the images for this integration +secretKey= + +#Request source name for your WebCt server +reqSrc=Blackboard CE + +# Url location of image folder containing the images for this integration # NOTE: This is cannot be changed without re-installing so be sure to check it. -imgUrl=http://192.168.111.30:8080/ -############################# \ No newline at end of file + imgUrl=http://localhost:8080/lams/images/treeicons/ + +############################# \ No newline at end of file Index: lams_webct_integration/package/lams2-webct-integration-1.0.0/build.properties =================================================================== RCS file: /usr/local/cvsroot/lams_webct_integration/package/lams2-webct-integration-1.0.0/Attic/build.properties,v diff -u -r1.1 -r1.2 --- lams_webct_integration/package/lams2-webct-integration-1.0.0/build.properties 8 Jan 2008 03:09:20 -0000 1.1 +++ lams_webct_integration/package/lams2-webct-integration-1.0.0/build.properties 1 Feb 2008 03:12:11 -0000 1.2 @@ -1,11 +1,14 @@ # Build.properties for configuring the LAMS/WebCt integration module -# WEBCT SETTINGS +# BLACKBOARD CE6 SETTINGS ############################# # Location of WebCt deployablecomponents directory webctDeployableComponentsDir=C:/bea815/weblogic81/config/WebCTDomain/deployablecomponents +# Put true if using CE 6.2 or newer OR put false if using an older version. +webctVersion_6.2=true + ############################## Index: lams_webct_integration/package/lams2-webct-integration-1.0.0/build.xml =================================================================== RCS file: /usr/local/cvsroot/lams_webct_integration/package/lams2-webct-integration-1.0.0/Attic/build.xml,v diff -u -r1.2 -r1.3 --- lams_webct_integration/package/lams2-webct-integration-1.0.0/build.xml 9 Jan 2008 02:05:43 -0000 1.2 +++ lams_webct_integration/package/lams2-webct-integration-1.0.0/build.xml 1 Feb 2008 03:12:11 -0000 1.3 @@ -1,6 +1,7 @@ + @@ -19,9 +20,20 @@ - + + + + + + + + + + + + Index: lams_webct_integration/package/lams2-webct-integration-1.0.0/readme.txt =================================================================== RCS file: /usr/local/cvsroot/lams_webct_integration/package/lams2-webct-integration-1.0.0/Attic/readme.txt,v diff -u -r1.1 -r1.2 --- lams_webct_integration/package/lams2-webct-integration-1.0.0/readme.txt 8 Jan 2008 03:09:20 -0000 1.1 +++ lams_webct_integration/package/lams2-webct-integration-1.0.0/readme.txt 1 Feb 2008 03:12:11 -0000 1.2 @@ -1,9 +1,12 @@ -WebCt - LAMS Integration Module -==================================== +Blackboard CE 6 (WebCt) - LAMS Integration Module +================================================= Written By Luke Foxton -LAMS Foundation Copyright (C) 2007 (http://lamsfoundation.org) +LAMS Foundation Copyright (C) 2008 (http://lamsfoundation.org) +For more information on and help, please visit the wiki at: +http://wiki.lamsfoundation.org/display/lamsdocs/Blackboard+CE+6 + Contents ================================================================================ 1. Requirements @@ -39,30 +42,74 @@ 3. Installation ================================================================================ -1) Install Blackboard CE 6.x on a server. -2) Download the WebCt-LAMS integration source package (see 3. Downloading the -package). -3) Open up the build.properties file (located in the root project directory) in -a text editor. -4) Follow the instructions to fill in the configuration details. NOTE: If your -database server is on a different server, then you must create the user and give -them permission to connect from other hosts. In MySql this is done for a user -named 'monty' with the following statement: - mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' IDENTIFIED BY 'some_pass'; -5) Run the create-table task from the Ant build.xml file. This can be done using -the following command - ant create-table -6) Set up a http server instance (for example Apacher Server) and copy the -images direcory in a web-accessable directory. -7) Run the Ant deploy task - ant deploy +Pre-Steps + +There is some setup before we can commence the installation of the Powerlink. + + 1. Follow the steps at in the appropriate Blackboard CE 6.x Setup guide to install Blackboard CE. Make sure you follow the correct setup guide for your version as the installation steps can change from version to version. The setup guides can be found at https://behind.blackboard.com/s/developer/refcenter/docs/. + 2. Install LAMS 2.0.6 or higher on a separate server. + 3. Ensure that each server can access the web addresses of the other, this can simply be done by accessing the LAMS or Blackboard CE login page. + 4. Set up a web server address to store the images used by the Powerlink. The easiest way to do this is to copy it into the LAMS server images folder. + Copy the 'treeicons' folder found in /path/to/lams2-webct-integration-1.0.0/deploy/web/tigra/ into /path/to/jboss-4.0.2/server/default/deploy/lams.ear/lams-central.war/images. + 5. Test that the images are accessible on the web by opening a web browser and going to http://:8080/lams/images/tigra_base.gif. + 6. Set up a MySql database which is accessible from the Blackboard CE server (This can be the same database as used for the LAMS server if appropriate). + 7. Set up a special MySql user which the Powerlink can use to talk to the database. Make sure the user has cross-server permission if the MySql server is not located on the same server as Blackboard CE. This can be done using a command on the MySql command line: + GRANT ALL PRIVILEGES ON TO ''@'' IDENTIFIED BY '. + 8. You can test the cross-server MySql access by installing a MySql client and the typing the following command: + mysql -h -u -p ; + +Installation of Powerlink + + 1. Download lams2-webct-integration-1.0.0.zip from the downloads page. (Not yet available for download) + 2. Unzip to a temporary location. + 3. The package should contain the following files: + + * apache-ant-1.7.0 (folder) + * db (folder) + * deploy (folder) + * lib (folder) + * build.properties + * build.xml + * DeployableComponentConfig.xml + * license.txt + * readme.txt + * release_notes.txt + + 4. Open up the build.properties in a text editor, you will need to change these entries to suit your own configuration. + NOTE: These settings can be configured in the Blackboard CE admin pages, EXCEPT for the image URL which must be correct, otherwise you will need to re-install the package. 4. Configuring WebCt Side ========================= + 1. Login to the Blackboard CE server as serveradmin. + 2. Make sure you are at the server level, by clicking it on the Administration tree one the left. + 3. Click on utilities (the red box) tab, then settings to get to the admin screen. + 4. Under the System Integration list there should now be a link called "LAMS Integration Module", click on that link. + 5. Select the true option of the Enable setting and also ensure you select the "Override Setting at Child Contexts" option to enable it at all contexts. + NOTE: DO NOT select the "Lock This Setting" Option yet as there have been known issues associated with this, these settings are only visible to the serveradmin user so there is no need to lock them. + 6. You can edit the other configuration fields (except of the image url), but make sure you select the "Override Setting at Child Contexts" option to filter the setting to all contexts. Again, do not lock the settings. + 7. Scroll down to the bottom of the page and click save to save the configuration. + 8. Next, click on the Powerlinks Proxy Tools tab, then click the Create Proxy Tool button. + 9. From the drop down menu, select "LAMS Integration Module". + 10. Enter the proxy tool name, version (1.0) and description, do not lock any of they settings, and do not select the "Release to My WebCT" option. + 11. Click save, the new Proxy Tool should appear in the list. + 12. Now return to the settings screen by clicking on the utilities (red box) tab then clicking settings. + 13. Under tools, a new link should appear with the same name as you used for the proxy tool name. Click it. + 14. The Enable Tool Field should be locked, you will need to unlock it first, then return to the menu again and select true to enable the tool. Make sure you select the "Override Setting at Child Contexts" also. - 5. Configuring LAMS Side ======================== + + 1. Follow the instructions to install LAMS, it is recommended that you install LAMS and Blackboard CE on separate servers to account for heavy memory requirements. You can either build LAMS  from source or follow the instructions for Window Installers  or Unix Installers.  + 2. Login to LAMS as sysadmin. + 3. Goto Sys Admin->Maintain integrated servers->Add New Server. + 4. Setup the fields to match those that you put on the Blackboard side + 5. The id and key should map to the "LAMS SERVER ID" and "LAMS SERVER SECRET KEY" fields respectively on the LAMS properties page in Blackboard (see above). + 6. Fill in a description of the Blackboard server. + 7. The "Prefix" field denotes a prefix that will be added to all users from Blackboard CE, for example if you put webct as the prefix and accessed LAMS with a user called "user", their name in LAMS would be "webct_user". + 8. The 'disabled' checkbox disables this integration, you can select this later if you wish to disable the connection. + 9. The User Information URL is arbitrary for LAMS/Blackboard CE integrations, so put a dummy URL in. + 10. You can specify a timeout page that LAMS will go to if there is an error. + Index: lams_webct_integration/package/lams2-webct-integration-1.0.0/release_notes.txt =================================================================== RCS file: /usr/local/cvsroot/lams_webct_integration/package/lams2-webct-integration-1.0.0/Attic/release_notes.txt,v diff -u -r1.1 -r1.2 --- lams_webct_integration/package/lams2-webct-integration-1.0.0/release_notes.txt 8 Jan 2008 03:09:20 -0000 1.1 +++ lams_webct_integration/package/lams2-webct-integration-1.0.0/release_notes.txt 1 Feb 2008 03:12:11 -0000 1.2 @@ -28,4 +28,5 @@ * Need a separate HTTP server to store images used for workspace tree. * Role mapping settings are only displayed under the instution admin screens. * User details are not updated to LAMS on change. +* Including xerces xml parser error. For CE 6.2 + version, you must include xercesImple.jar. Index: lams_webct_integration/package/lams2-webct-integration-1.0.0/apache-ant-1.7.0/lib/ant-contrib-1.0b3.jar =================================================================== RCS file: /usr/local/cvsroot/lams_webct_integration/package/lams2-webct-integration-1.0.0/apache-ant-1.7.0/lib/Attic/ant-contrib-1.0b3.jar,v diff -u Binary files differ Index: lams_webct_integration/src/org/lamsfoundation/integration/webct/LamsLesson.java =================================================================== RCS file: /usr/local/cvsroot/lams_webct_integration/src/org/lamsfoundation/integration/webct/LamsLesson.java,v diff -u -r1.3 -r1.4 --- lams_webct_integration/src/org/lamsfoundation/integration/webct/LamsLesson.java 1 Feb 2008 03:03:23 -0000 1.3 +++ lams_webct_integration/src/org/lamsfoundation/integration/webct/LamsLesson.java 1 Feb 2008 03:11:41 -0000 1.4 @@ -1,3 +1,26 @@ +/**************************************************************** + * Copyright (C) 2007 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.integration.webct; Index: lams_webct_integration/src/org/lamsfoundation/integration/webct/LamsModule.java =================================================================== RCS file: /usr/local/cvsroot/lams_webct_integration/src/org/lamsfoundation/integration/webct/LamsModule.java,v diff -u -r1.7 -r1.8 --- lams_webct_integration/src/org/lamsfoundation/integration/webct/LamsModule.java 20 Dec 2007 00:51:49 -0000 1.7 +++ lams_webct_integration/src/org/lamsfoundation/integration/webct/LamsModule.java 1 Feb 2008 03:11:41 -0000 1.8 @@ -1,3 +1,26 @@ +/**************************************************************** + * Copyright (C) 2007 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.integration.webct; import java.io.StringWriter; @@ -12,6 +35,7 @@ import java.util.Calendar; import java.sql.Timestamp; + import javax.security.auth.login.LoginException; import javax.servlet.http.HttpServletRequest; @@ -45,6 +69,7 @@ public static final String VERSION = "1.0.0"; public static final String JARSTR = "lams2-webct-integration-" + VERSION + ".jar"; + private HttpServletRequest request = null; private SessionVO _sessionVO; private LearningCtxtVO _currentLearningContext; @@ -112,6 +137,7 @@ Map params = new HashMap(); String html=null; String authorUrl = null; + String learningDesigns = null; String learnerUrl = ""; String monitorUrl = ""; @@ -152,12 +178,6 @@ this.lamsServerId = (String)settings.get(Constants.SETTING_SERVER_ID); this.lamsServerSecretKey = (String)settings.get(Constants.SETTING_SECRET_KEY); this.webctRequestSource = (String)settings.get(Constants.SETTING_REQUEST_SRC); - //System.out.println("TESTING:"); - //System.out.println((String)settings.get("glcid")); - //System.out.println(lamsServerUrl); - //System.out.println(lamsServerId); - //System.out.println(lamsServerSecretKey); - //System.out.println(webctRequestSource); boolean canAuthor = hasLamsRole("authorRoles"); boolean canMonitor = hasLamsRole("monitorRoles"); @@ -174,6 +194,9 @@ String action = request.getParameter("form_action"); + + authorUrl = generateRequestURL(user, lcID, "author"); + if(action==null || action.trim().length()==0) { @@ -199,12 +222,12 @@ params.put("learnerUrl", learnerUrl); params.put("monitorUrl", monitorUrl); params.put("liveEditUrl", authorUrl); + params.put("authorUrl", authorUrl); html = this.generatePage("web/teach.vm", params); } catch (Exception e) { - e.printStackTrace(); log.error("Error creating LAMS teach page", e); throw new LoginException("Error creating LAMS teach page"); } @@ -240,9 +263,53 @@ { // goto create lesson form try { - // get the authorUrl for the author link - authorUrl = generateRequestURL(user, lcID, "author"); - params.put("authorUrl", authorUrl); + + // prefilling the start time variable + Calendar cal = Calendar.getInstance(); + int mins = cal.get(Calendar.MINUTE); + if (mins > 55) + mins=55; + mins = (mins / 5) * 5; // round to nearest 5 lower than mins + + String ampm = null; + if (cal.get(Calendar.AM_PM)==1) + { + ampm="PM"; + } + else + { + ampm="AM"; + } + params.put("date", calendarToString(cal)); + params.put("sth" + cal.get(Calendar.HOUR), Constants.SELECTED); + params.put("stm" + mins, Constants.SELECTED); + params.put("st" + ampm, Constants.SELECTED); + + + // prefilling the end time variable + Calendar calend = Calendar.getInstance(); + calend.add(Calendar.MINUTE, 5); + int endmins = calend.get(Calendar.MINUTE); + if (endmins > 55) + endmins=55; + endmins = (endmins / 5) * 5; // round to nearest 5 lower than mins + + String endampm = null; + if (calend.get(Calendar.AM_PM)==1) + { + endampm="PM"; + } + else + { + endampm="AM"; + } + params.put("dateEnd", calendarToString(calend)); + params.put("eh" + calend.get(Calendar.HOUR), Constants.SELECTED); + params.put("em" + endmins, Constants.SELECTED); + params.put("e" + endampm, Constants.SELECTED); + + + params.put("authorUrl", authorUrl); // get the learning designs to display the workspace tree learningDesigns = getLearningDesigns(user, lcID); @@ -328,25 +395,26 @@ Timestamp start = null; Timestamp end = null; - if (request.getParameter("schedule").equals("true")) + //if (request.getParameter("schedule").equals("true")) + + if (request.getParameter("dateStart")!=null && !request.getParameter("dateStart").equals("")) { - if (request.getParameter("dateStart")!=null && !request.getParameter("dateStart").equals("")) - { - start = getTimeStamp(request.getParameter("dateStart"), - request.getParameter("startHour"), - request.getParameter("startMin"), - request.getParameter("startAMPM")); - } - - if (request.getParameter("dateEnd")!=null && !request.getParameter("dateEnd").equals("")) - { - - end = getTimeStamp(request.getParameter("dateEnd"), - request.getParameter("endHour"), - request.getParameter("endMin"), - request.getParameter("endAMPM")); - } + start = getTimeStamp(request.getParameter("dateStart"), + request.getParameter("startHour"), + request.getParameter("startMin"), + request.getParameter("startAMPM")); } + + if (request.getParameter("dateEnd")!=null && !request.getParameter("dateEnd").equals("") + && request.getParameter("schedule").equals("true")) + { + + end = getTimeStamp(request.getParameter("dateEnd"), + request.getParameter("endHour"), + request.getParameter("endMin"), + request.getParameter("endAMPM")); + } + ILamsLessonDao lessonDao = new LamsLessonDaoMySqlJDBC(settings); LamsLesson lesson = new LamsLesson( @@ -360,7 +428,7 @@ user.getFirstname(), user.getLastname(), request.getParameter("isAvailable").equals("false"), - request.getParameter("schedule").equals("true"), + true, start, end ); @@ -464,20 +532,33 @@ } params.put("startStr", dayStr + "/" + monthStr + "/" + calendarStart.get(Calendar.YEAR)); - params.put("stHrCk" + calendarStart.get(Calendar.HOUR), "selected" ); - params.put("stMnCk" + calendarStart.get(Calendar.MINUTE), "selected" ); - params.put("stAmCk" + calendarStart.get(Calendar.AM_PM), "selected" ); + params.put("stHrCk" + calendarStart.get(Calendar.HOUR), Constants.SELECTED ); + params.put("stMnCk" + calendarStart.get(Calendar.MINUTE), Constants.SELECTED ); + params.put("stAmCk" + calendarStart.get(Calendar.AM_PM), Constants.SELECTED ); } else { - params.put("startStr", ""); - params.put("stHrCk9", "selected" ); - params.put("stMnCk0", "selected" ); - params.put("stAmCk0", "selected" ); + // put the current time in the start field + Calendar cal = Calendar.getInstance(); + int mins = cal.get(Calendar.MINUTE); + if (mins > 55) + mins=55; + mins = (mins / 5) * 5; // round to nearest 5 lower than mins + + + + params.put("startStr", this.calendarToString(cal)); + params.put("stHrCk" + cal.get(Calendar.HOUR), Constants.SELECTED ); + params.put("stMnCk" + mins, Constants.SELECTED ); + params.put("stAmCk" + cal.get(Calendar.AM_PM), Constants.SELECTED ); } if (modLesson.getEndTimestamp()!=null) { + // set the end time to the persited value + params.put("endDisabled", ""); + params.put("schedule", Constants.CHECKED); + Calendar calendarEnd = Calendar.getInstance(); calendarEnd.setTime(modLesson.getEndTimestamp()); @@ -493,17 +574,59 @@ monthStr = "0" + monthStr; } + + params.put("endStr", dayStr + "/" + monthStr + "/" + calendarEnd.get(Calendar.YEAR)); - params.put("edHrCk" + calendarEnd.get(Calendar.HOUR), "selected" ); - params.put("edMnCk" + calendarEnd.get(Calendar.MINUTE), "selected" ); - params.put("edAmCk" + calendarEnd.get(Calendar.AM_PM), "selected" ); + params.put("endStrGenerated", dayStr + "/" + monthStr + "/" + calendarEnd.get(Calendar.YEAR)); + params.put("edHrCk" + calendarEnd.get(Calendar.HOUR), Constants.SELECTED ); + params.put("edMnCk" + calendarEnd.get(Calendar.MINUTE), Constants.SELECTED ); + params.put("edAmCk" + calendarEnd.get(Calendar.AM_PM), Constants.SELECTED ); } else { - params.put("endStr", ""); - params.put("edHrCk9", "selected" ); - params.put("edMnCk0", "selected" ); - params.put("edAmCk0", "selected" ); + // prefilling the end time variable + + if (modLesson.getStartTimestamp()!= null) + { + // no end time find in db, so + // set the default end time to 5 minutes after the start + Calendar calend = Calendar.getInstance(); + calend.setTime(modLesson.getStartTimestamp()); + calend.add(Calendar.MINUTE, 5); + + int endmins = calend.get(Calendar.MINUTE); + if (endmins > 55) + endmins=55; + endmins = (endmins / 5) * 5; // round to nearest 5 lower than mins + + + params.put("endStr", ""); + params.put("endStrGenerated", calendarToString(calend)); + params.put("edHrCk" + calend.get(Calendar.HOUR), Constants.SELECTED); + params.put("edMnCk" + endmins, Constants.SELECTED); + params.put("edAmCk" + calend.get(Calendar.AM_PM), Constants.SELECTED); + } + else + { + // if there is no start time, + // set the defualt end time to 5 minutes after now + Calendar calend = Calendar.getInstance(); + calend.add(Calendar.MINUTE, 5); + int endmins = calend.get(Calendar.MINUTE); + if (endmins > 55) + endmins=55; + endmins = (endmins / 5) * 5; // round to nearest 5 lower than mins + + params.put("edHrCk" + calend.get(Calendar.HOUR), Constants.SELECTED ); + params.put("edMnCk" + endmins, Constants.SELECTED ); + params.put("edAmCk" + calend.get(Calendar.AM_PM), Constants.SELECTED ); + params.put("endStr", this.calendarToString(calend)); + params.put("endStrGenerated", this.calendarToString(calend)); + } + + params.put("endDisabled", Constants.DISABLED); + params.put("notschedule", Constants.CHECKED); + } if (modLesson.getHidden()) @@ -515,20 +638,12 @@ params.put("nothidden", "checked"); } - - if (modLesson.getSchedule()) - { - params.put("schedule", "checked"); - } - else - { - params.put("notschedule", "checked"); - } - html = this.generatePage("web/modify.vm", params); } catch (Exception e) { + e.printStackTrace(); + log.error("Error creating LAMS lesson modify page: ", e); throw new LoginException("Error creating LAMS lesson modify page: " + e.getMessage()); } @@ -544,38 +659,34 @@ modLesson.setTitle(LamsSecurityUtil.replace(request.getParameter("title"), '\'', "\\'")); modLesson.setDescription(LamsSecurityUtil.replace(request.getParameter("description"), '\'', "\\'")); modLesson.setHidden(request.getParameter("isAvailable").equals("false")); - modLesson.setSchedule(request.getParameter("schedule").equals("true")); + modLesson.setSchedule(true); Timestamp start = null; Timestamp end = null; - if (request.getParameter("schedule").equals("true")) - { - if (request.getParameter("dateStart")!=null && !request.getParameter("dateStart").equals("")) - { + + if (request.getParameter("dateStart")!=null && !request.getParameter("dateStart").equals("")) + { start = getTimeStamp(request.getParameter("dateStart"), request.getParameter("startHour"), request.getParameter("startMin"), request.getParameter("startAMPM")); - } + } - if (request.getParameter("dateEnd")!=null && !request.getParameter("dateEnd").equals("")) - { + if (request.getParameter("dateEnd")!=null && !request.getParameter("dateEnd").equals("")) + { end = getTimeStamp(request.getParameter("dateEnd"), request.getParameter("endHour"), request.getParameter("endMin"), request.getParameter("endAMPM")); - } - } - + } + modLesson.setStartTimestamp(start); modLesson.setEndTimestamp(end); - - + boolean success = lessonDao.updateLesson(modLesson); - if (success) { params.put("successMessage", "LAMS lesson updated successfully."); @@ -749,48 +860,7 @@ } //System.out.print("\n"); return hasLameRole; - - - /* - - boolean hasLameRole = false; - - System.out.println(settings.get(lamsRoleType).toString()); - System.out.println((String)settings.get(lamsRoleType)); - - //String learnerRoles[] = ((String)settings.get(lamsRoleType)).split("|"); - - String learnerRoles = settings.get(lamsRoleType).toString(); - - UserVO user = null; - try - { - user = UserService.getInstance().getUser(super.getUserId(), this.lcID); - } - catch (Exception e) - { - e.printStackTrace(); - } - - List roles = user.getUserRoles(); - Iterator it = roles.iterator(); - - - - while (it.hasNext()) - { - String role = it.next().toString().trim(); - if (learnerRoles.indexOf(role) != -1) - { - hasLameRole=true; - } - } - - return hasLameRole; - */ - - } /** @@ -834,6 +904,27 @@ { return super.logout(); } + + public String calendarToString(Calendar cal) + { + int day = cal.get(Calendar.DAY_OF_MONTH); + int month = cal.get(Calendar.MONTH) + 1; + int year = cal.get(Calendar.YEAR); + String dayStr = "" + day; + String monthStr = "" + month; + if (day < 10) + { + dayStr = "0" + day; + } + if (month < 10) + { + monthStr = "0" + month; + } + return dayStr + "/" + monthStr + "/" + year; + + } + + } \ No newline at end of file