Index: lams_bb_integration/web/modules/modify.jsp
===================================================================
diff -u -r8ea6dac2e1f9e39a41030dd5907592bc2aa04d17 -re90547eeb5330fd68c424212233b1689f25c71ce
--- lams_bb_integration/web/modules/modify.jsp (.../modify.jsp) (revision 8ea6dac2e1f9e39a41030dd5907592bc2aa04d17)
+++ lams_bb_integration/web/modules/modify.jsp (.../modify.jsp) (revision e90547eeb5330fd68c424212233b1689f25c71ce)
@@ -1,120 +1,158 @@
-<%@ page import="java.util.*,
- java.util.Date,
- java.text.SimpleDateFormat,
- blackboard.data.*,
- blackboard.persist.*,
- blackboard.data.course.*,
- blackboard.data.user.*,
- blackboard.persist.course.*,
- blackboard.data.content.*,
- blackboard.persist.content.*,
- blackboard.db.*,
- blackboard.base.*,
- blackboard.platform.*,
- blackboard.platform.plugin.*"
- errorPage="/error.jsp"
-%>
-<%@ taglib uri="/bbUI" prefix="bbUI"%>
-<%@ taglib uri="/bbData" prefix="bbData"%>
-
+<%--
+ Original Version: 2007 LAMS Foundation
+ Updated for Blackboard 9.1 SP6 (including new bbNG tag library) 2011
+ Richard Stals (www.stals.com.au)
+ Edith Cowan University, Western Australia
+--%>
+<%--
+ Step 1 For Modifing an existing LAMS Lesson
+ Set the various attributes for the LAMS lesson in Blackboard
+ Step 1 - modify.jsp
+ Step 2 - modify_proc.jsp
+--%>
+<%@ page import="java.util.*"%>
+<%@ page import="java.util.Date"%>
+<%@ page import="java.util.Calendar"%>
+<%@ page import="java.text.SimpleDateFormat"%>
+<%@ page import="blackboard.data.*"%>
+<%@ page import="blackboard.persist.*"%>
+<%@ page import="blackboard.data.course.*"%>
+<%@ page import="blackboard.data.user.*"%>
+<%@ page import="blackboard.persist.course.*"%>
+<%@ page import="blackboard.data.content.*"%>
+<%@ page import="blackboard.persist.content.*"%>
+<%@ page import="blackboard.db.*"%>
+<%@ page import="blackboard.base.*"%>
+<%@ page import="blackboard.platform.*"%>
+<%@ page import="blackboard.platform.plugin.*"%>
+<%@ page errorPage="/error.jsp"%>
+<%@ taglib uri="/bbNG" prefix="bbNG"%>
+
+
<%
String NOT_AVAILABLE = "Item is not available.
";
- //check permission
- if (!PlugInUtil.authorizeForCourseControlPanel(request, response))
- return;
+ // SECURITY!
+ // Authorise current user for Course Control Panel (automatic redirect)
+ try{
+ if (!PlugInUtil.authorizeForCourseControlPanel(request, response))
+ return;
+ } catch(PlugInException e) {
+ throw new RuntimeException(e);
+ }
- BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager();
+ // Retrieve the Db persistence manager from the persistence service
+ BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager();
+
+ // Get the content ID for this item
Container bbContainer = bbPm.getContainer();
+ Id contentId = new PkId( bbContainer, CourseDocument.DATA_TYPE, request.getParameter("content_id") );
- Id contentId = new PkId( bbContainer, CourseDocument.COURSE_DOCUMENT_DATA_TYPE, request.getParameter("content_id") );
-
+ // Load the Course Document (Lams Lesson)
ContentDbLoader courseDocumentLoader = (ContentDbLoader) bbPm.getLoader( ContentDbLoader.TYPE );
Content courseDoc = (Content)courseDocumentLoader.loadById( contentId );
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- Date startDate = null;
- Date endDate = null;
-
- if(courseDoc.getStartDate() != null)
- startDate = courseDoc.getStartDate().getTime();
- if(courseDoc.getEndDate() != null)
- endDate = courseDoc.getStartDate().getTime();
-
+ // Get the Item Attributes
+ Calendar startDate = courseDoc.getStartDate();
+ Calendar endDate = courseDoc.getEndDate();
FormattedText desc = courseDoc.getBody();
String description = desc.getText().replaceFirst(NOT_AVAILABLE, ""); //remove the NOT_AVAILABLE substring
%>
-
-
-
-
- Modify HTML Block
-
-Modify LAMS
-
-
+
+
+
+
+
+
+
+
+
+ >Yes
+ >No
+
+
+
+ >Yes
+ >No
+
+
+
+ <%--
+ Show start and end dates if they have been set
+ If non ehave been set, leave the tags out so that Blackboard puts the default dates in
+ --%>
+ <% if(startDate==null && endDate==null) { %>
+
+ <% } else if(endDate==null) { %>
+
+ <% } else if(startDate==null) { %>
+
+ <% } else { %>
+
+ <% } %>
+
+
+
+
+
-
-
-
+
+
+
+
+
+