Skip to content
Snippets Groups Projects
Commit 2a08854c authored by Roger W Feese's avatar Roger W Feese
Browse files

Initial import.

parent e33edadb
No related branches found
No related tags found
No related merge requests found
Copyright (c) 2006 University of Nebraska-Lincoln
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Course Migration Blackboard Module
This is a Blackboard module designed to display a list of courses that an
instructor can choose from to request migration to the replacement server.
Project Directory Structure
The project is set up to build using Ant. The primary build
configuration is in the "build.xml" file.
/ project root
/lib Java libraries needed for build or run-time
/src Source files for any unique Java classes used in this project
/web JSP, HTML, CSS, JavaScript or other web files or templates
/conf App configuration files such as web.xml
/config Taglibs directory used by Bb building block
/build Dynamically created data generated by Ant build targets.
Important build targets:
webapp Builds the webapp directory structure in /build/webapp.
war Creates a deployable WAR file.
bb-platform.jar=
bb-taglibs.jar=
tomcat_common_lib.dir=
tomcat_server_lib.dir=
commons-logging-api.jar=
jstl.jar=
standard.jar=
#starting block parameters for testing -- only needed for deploytotest target
testuser=
testpasswd=
testhost=
build.xml 0 → 100644
<project name="crs_migrate_bb" default="war" basedir=".">
<!-- Set some project variables and parameters -->
<!-- build.properties for local config customizations -->
<property file="build.properties" />
<property name="warname" value="crs_migrate_bb.war" />
<property name="src.dir" value="src" />
<property name="conf.dir" value="conf" />
<property name="build.dir" value="build" />
<property name="webapp.dir" value="${build.dir}/webapp" />
<property name="classes.dir" value="${webapp.dir}/WEB-INF/classes" />
<property name="lib.dir" value="lib" />
<property name="web_root.dir" value="web" />
<property name="taglib.dir" value="config" />
<path id="classes-build-classpath">
<pathelement location="${lib.dir}" />
<pathelement location="${bb-platform.jar}" />
<pathelement location="${bb-taglibs.jar}" />
<pathelement location="${jstl.jar}" />
<pathelement location="${standard.jar}" />
<pathelement location="${commons-logging-api.jar}" />
<fileset dir="${tomcat_common_lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${tomcat_server_lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<path id="jsp-build-classpath">
<path refid="classes-build-classpath" />
<pathelement location="${classes.dir}" />
</path>
<!-- Remove all compiled and built components -->
<target name="clean">
<delete dir="${classes.dir}" />
<delete dir="${build.dir}" />
</target>
<target name="build_prep">
<mkdir dir="${build.dir}" />
<mkdir dir="${webapp.dir}" />
</target>
<!-- Compile local Java source files into class files. -->
<target name="compile_java_classes" depends="build_prep">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" />
</target>
<!-- define jasper (tomcat jsp compiler) task since the built-in jspc task doesn't work -->
<taskdef classname="org.apache.jasper.JspC" name="jasper2">
<classpath refid="jsp-build-classpath" />
</taskdef>
<!-- compile JSP to syntax check -->
<target name="compile_jsp" depends="webapp">
<mkdir dir="${build.dir}/jasper_java" />
<mkdir dir="${build.dir}/jasper_classes" />
<jasper2 verbose="9" outputDir="${build.dir}/jasper_java" uriroot="${webapp.dir}"/>
<!-- build the generated servlet code -->
<javac srcdir="${build.dir}/jasper_java" destdir="${build.dir}/jasper_classes">
<classpath refid="jsp-build-classpath" />
</javac>
</target>
<!-- Create the webapp directory structure in the build directory -->
<target name="webapp" depends="compile_java_classes">
<!-- copy config -->
<copy todir="${webapp.dir}/WEB-INF" file="${conf.dir}/web.xml" />
<copy todir="${webapp.dir}/WEB-INF" file="${conf.dir}/bb-manifest.xml" />
<copy todir="${webapp.dir}/META-INF" file="${conf.dir}/MANIFEST.MF" />
<!-- copy web content -->
<copy todir="${webapp.dir}">
<fileset dir="${web_root.dir}" />
</copy>
<!-- copy libs -->
<copy todir="${webapp.dir}/WEB-INF/lib">
<fileset dir="${lib.dir}" />
</copy>
<copy todir="${webapp.dir}/WEB-INF/config">
<fileset dir="${taglib.dir}" />
</copy>
</target>
<!-- Build the WAR file for deployment to server -->
<target name="war" depends="compile_java_classes">
<war destfile="${build.dir}/${warname}" webxml="${conf.dir}/web.xml" manifest="${conf.dir}/MANIFEST.MF">
<!-- copy docroot -->
<fileset dir="${web_root.dir}" />
<!-- copy classes -->
<classes dir="${classes.dir}" />
<!-- copy libs -->
<lib dir="${lib.dir}" />
<!-- insert the Blackboard manifest -->
<webinf file="${conf.dir}/bb-manifest.xml" />
<!-- include the confg directory (taglibs) -->
<webinf dir="." includes="config/" />
</war>
</target>
<!-- deploy to test servers (requires the starting block building block) -->
<target name="deploytotest" depends="war">
<scp file="${build.dir}/${warname}" todir="${testuser}:${testpasswd}@${testhost}:/tmp/" />
<get src="http://${testhost}/webapps/bb-starting-block-bb_bb60/execute/install?fileName=/tmp/${warname}&amp;clean=true&amp;available=true" dest="${build.dir}/deploytotest_response" />
</target>
</project>
Manifest-Version: 1.0
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<plugin>
<name value="Courses to Migrate Module"/>
<handle value="crs_migrate_bb"/>
<description value="Displays a list of courses the user is Instructing and allows them to designate the ones to be migrated to the new server."/>
<version value="0.1"/>
<requires>
<bbversion value="8.0.0"/>
</requires>
<vendor>
<id value="unl"/>
<name value="University of Nebraska-Lincoln"/>
<url value="http://www.unl.edu/" />
<description value="UNL" />
</vendor>
<module-defs>
<module-type ext-ref="course_migrate" title="Courses to Migrate" uicreatable="false">
<jsp-dir>module</jsp-dir>
<jsp>
<view>view.jsp</view>
</jsp>
</module-type>
<module type="course_migrate" isadmin="false" useraddable="false" isdeletable="false" isdetachable="false" title="Courses to Migrate">
<description>Displays a list of courses the user is instructing so that they may designate the ones that should be migrated to the new server.</description>
<ExtraInfo />
</module>
</module-defs>
<permissions>
<permission type="attribute" name="user.authinfo" actions="get"/>
<permission type="runtime" name="db.connection.*"/>
</permissions>
</plugin>
</manifest>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>AppDisplayName</display-name>
<jsp-config>
</jsp-config>
</web-app>
<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="blackboard.base.BbList" %>
<%@ page import="blackboard.data.course.Course" %>
<%@ page import="blackboard.data.course.CourseMembership" %>
<%@ page import="blackboard.db.ConnectionManager" %>
<%@ page import= "blackboard.platform.session.*" %>
<%@ page import="blackboard.persist.course.CourseDbLoader" %>
<%@ taglib uri="/bbUI" prefix="bbUI" %>
<%@ taglib uri="/bbData" prefix="bbData"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<bbData:context id="ctx">
<%
BbList.Iterator coursesInstructingIterator = null;
ConnectionManager connectionManager = ConnectionManager.getDefaultInstance();
Connection dbConnection = connectionManager.getConnection();
try{
CourseDbLoader cLoader = (CourseDbLoader) CourseDbLoader.Default.getInstance();
BbList coursesInstructing = cLoader.loadByUserIdAndCourseMembershipRole(ctx.getUser().getId(), CourseMembership.Role.INSTRUCTOR, dbConnection);
coursesInstructingIterator = coursesInstructing.getFilteringIterator();
}
catch(Exception e){
e.printStackTrace(new PrintWriter(out));
}
dbConnection.close();
//pageContext.setAttribute("courses", coursesInstructingIterator);
%>
<p>Specify the courses that should be migrated to the new Blackboard server. Migrations will be scheduled to occur overnight. Once a course has been migrated, it will no longer appear in this list.</p>
<form>
<%--
<ul>
<c:forEach var="courses" items="${courses}">
<li>${course.courseId}&nbsp;${course.title}</li>
</c:forEach>
</ul>
--%>
<ul>
<%
while(coursesInstructingIterator.hasNext()){
Course course = (Course) coursesInstructingIterator.next();
%>
<li><input type="checkbox" id="migrate_<%= course.getCourseId() %>" value="migrate_<%= course.getCourseId() %>"><label for=""><%= course.getCourseId() %>&nbsp;<%= course.getTitle() %></label></li>
<%
}
%>
</ul>
<input type="submit" value="Mark Selected Courses for Migration">
</form>
</bbData:context>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment