• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Course类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中blackboard.data.course.Course的典型用法代码示例。如果您正苦于以下问题:Java Course类的具体用法?Java Course怎么用?Java Course使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Course类属于blackboard.data.course包,在下文中一共展示了Course类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: start

import blackboard.data.course.Course; //导入依赖的package包/类
/**
    * Starts preview lesson on LAMS server. Launches it.
    */
   private void start(HttpServletRequest request, HttpServletResponse response, Context ctx) throws IOException, ServletException, PersistenceException, ParseException, ValidationException, ParserConfigurationException, SAXException {

   	BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager();

//store newly created LAMS lesson
User user = ctx.getUser();
BlackboardUtil.storeBlackboardContent(request, response, user);

// constuct strReturnUrl
String courseIdStr = request.getParameter("course_id");
String contentIdStr = request.getParameter("content_id");
// internal Blackboard IDs for the course and parent content item
Id courseId = bbPm.generateId(Course.DATA_TYPE, courseIdStr);
Id folderId = bbPm.generateId(CourseDocument.DATA_TYPE, contentIdStr);
String returnUrl = PlugInUtil.getEditableContentReturnURL(folderId, courseId);
request.setAttribute("returnUrl", returnUrl);

request.getRequestDispatcher("/modules/startLessonSuccess.jsp").forward(request, response);
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:LessonManagerServlet.java


示例2: getAuditLog

import blackboard.data.course.Course; //导入依赖的package包/类
/**
 * Displays an audit log of when students were added/removed to/from groups
 * for a single course.
 * 
 * @param request the request from the remote client.
 * @param response the response to be returned to the remote client.
 * @return the data model and view of it to be rendered.
 * @throws UnsupportedEncodingException if the US-ASCII character set is
 * not supported, and as such URL elements cannot be encoded.
 */
@RequestMapping("/index")
public ModelAndView getAuditLog(final HttpServletRequest request, final HttpServletResponse response)
        throws UnsupportedEncodingException {
    final Context context = ContextManagerFactory.getInstance().getContext();
    final ModelAndView modelAndView = new ModelAndView("auditLog");
    final Course course = context.getCourse();
    final List<EnrolmentChangePart> pendingChange = new ArrayList<EnrolmentChangePart>();
    
    pendingChange.addAll(this.getEnrolmentChangePartDao().getByCourse(course));
    Collections.sort(pendingChange);
    
    modelAndView.addObject("activities", PlugInUtil.getUri(PLUGIN_VENDOR_ID,
            PLUGIN_ID, "activities?course_id="
            + URLEncoder.encode(course.getId().getExternalString(), US_ASCII)));
    modelAndView.addObject("mergedCourses", PlugInUtil.getUri(PLUGIN_VENDOR_ID,
            PLUGIN_ID, "mergedCourses?course_id="
            + URLEncoder.encode(course.getId().getExternalString(), US_ASCII)));
    modelAndView.addObject("changes", pendingChange);
    
    return modelAndView;
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:32,代码来源:AuditLogController.java


示例3: getActivities

import blackboard.data.course.Course; //导入依赖的package包/类
/**
 * Displays a list of activities related to a course in Learn.
 * 
 * @param request the request from the remote client.
 * @param response the response to be returned to the remote client.
 * @return the data model and view of it to be rendered.
 * @throws UnsupportedEncodingException if the US-ASCII character set is
 * not supported, and as such URL elements cannot be encoded.
 */
@RequestMapping("/activities")
public ModelAndView getActivities(final HttpServletRequest request, final HttpServletResponse response)
        throws UnsupportedEncodingException {
    final Context context = ContextManagerFactory.getInstance().getContext();
    final ModelAndView modelAndView = new ModelAndView("activities");
    final Course course = context.getCourse();
    final List<Activity> activities = getActivityDao().getByCourseLearnId(course.getId());
    
    modelAndView.addObject("activities", activities);
    modelAndView.addObject("auditLog", PlugInUtil.getUri(PLUGIN_VENDOR_ID,
            PLUGIN_ID, "index?course_id="
            + URLEncoder.encode(course.getId().getExternalString(), US_ASCII)));
    modelAndView.addObject("mergedCourses", PlugInUtil.getUri(PLUGIN_VENDOR_ID,
            PLUGIN_ID, "mergedCourses?course_id="
            + URLEncoder.encode(course.getId().getExternalString(), US_ASCII)));
    
    return modelAndView;
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:28,代码来源:ActivitiesController.java


示例4: getMergedCourses

import blackboard.data.course.Course; //导入依赖的package包/类
/**
 * Displays details of merged courses that are brought into this course.
 * 
 * @param request the request from the remote client.
 * @param response the response to be returned to the remote client.
 * @return the data model and view of it to be rendered.
 * @throws SQLException if there was a problem accessing the database.
 * @throws UnsupportedEncodingException if the US-ASCII character set is
 * not supported, and as such URL elements cannot be encoded.
 */
@RequestMapping("/mergedCourses")
public ModelAndView getMergedCourses(final HttpServletRequest request, final HttpServletResponse response)
        throws UnsupportedEncodingException, SQLException {
    final Context context = ContextManagerFactory.getInstance().getContext();
    final ModelAndView modelAndView = new ModelAndView("mergedCourses");
    final Course course = context.getCourse();
    
    final LearnCourseCode courseCode = new LearnCourseCode(course.getCourseId());
    final List<LearnCourseCode> mergedCourseCodes = new ArrayList<LearnCourseCode>();
    
    mergedCourseCodes.addAll(this.getMergedCoursesService().getMergedCourses(courseCode));
    
    // XXX: Resolve JTA activities here.
    
    modelAndView.addObject("activities", PlugInUtil.getUri(PLUGIN_VENDOR_ID,
            PLUGIN_ID, "activities?course_id="
            + URLEncoder.encode(course.getId().getExternalString(), US_ASCII)));
    modelAndView.addObject("auditLog", PlugInUtil.getUri(PLUGIN_VENDOR_ID,
            PLUGIN_ID, "index?course_id="
            + URLEncoder.encode(course.getId().getExternalString(), US_ASCII)));
    modelAndView.addObject("mergedCourseCodes", mergedCourseCodes);
    
    return modelAndView;
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:35,代码来源:MergedCoursesController.java


示例5: emailMemberships

import blackboard.data.course.Course; //导入依赖的package包/类
public List<MailException> emailMemberships()
    throws PersistenceException {
    if (this.unsafeMemberships.isEmpty()) {
        return Collections.EMPTY_LIST;
    }
    
    final List<MailException> mailErrors = new ArrayList<MailException>();        
    
    for (Course course: this.unsafeMemberships.keySet()) {
        final Collection<GroupMembership> memberships = this.unsafeMemberships.get(course);
        final SimpleMailMessage message = this.buildMessage(course, memberships);
        
        if (null != message) {
            try {
                this.mailSender.send(message);
            } catch(MailException e) {
                mailErrors.add(e);
            }
        }
    }
    
    return mailErrors;
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:24,代码来源:UnsafeGroupMembershipManager.java


示例6: getInstructorAddresses

import blackboard.data.course.Course; //导入依赖的package包/类
private Collection<String> getInstructorAddresses(final Course course)
        throws KeyNotFoundException, PersistenceException {
    final Set<String> emailAddresses = new HashSet<String>();
    
    for (CourseMembership membership: this.courseMembershipLoader.loadByCourseIdAndInstructorFlag(course.getId())) {
        final User user = this.userLoader.loadById(membership.getUserId());
        
        assert null != user;
        if (null == user.getEmailAddress()) {
            log.info("No e-mail address listed for instructor "
                + user.getGivenName() + " "
                + user.getFamilyName() + " ("
                + user.getUserName() + ").");
            continue;
        }
        
        emailAddresses.add(user.getEmailAddress());
    }
    
    return emailAddresses;
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:22,代码来源:UnsafeGroupMembershipManager.java


示例7: buildCourseGroup

import blackboard.data.course.Course; //导入依赖的package包/类
/**
 * Constructs a new course group and returns it.
 *
 * @param course the course that the group will belong to.
 * @param groupName the name of the group.
 * @return the new group.
 */
public Group buildCourseGroup(final Course course, final String groupName,
        final FormattedText description) {
    assert null != course;
    assert null != groupName;
    assert null != description;
    
    // Create the new group
    final Group group = new Group();
    group.setCourseId(course.getId());
    group.setTitle(groupName);
    group.setIsAvailable(false);
    group.setSelfEnrolledAllowed(false);
    group.setDescription(description);
    return group;
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:23,代码来源:BlackboardService.java


示例8: createContent

import blackboard.data.course.Course; //导入依赖的package包/类
public void createContent(String title, String inputHtml, String sCourseId, String sParentId) throws PersistenceException, ValidationException {
	
	// okay from here down
	// retrieve the Db persistence manager from the persistence service 
	BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager(); 
	// create a course document and set all desired attributes 
	Content content = new Content(); 
	content.setTitle( title ); 
	FormattedText text = new FormattedText( inputHtml , FormattedText.Type.HTML ); 
	content.setBody( text ); 
	content.setContentHandler( "resource/x-bb-document" ); 
	// ... set additional attributes ... 
	// these attributes of content require valid Ids... create and set them 
	Id courseId = bbPm.generateId( Course.DATA_TYPE, sCourseId ); 
	Id parentId = bbPm.generateId( Content.DATA_TYPE, sParentId ); 
	content.setCourseId( courseId ); 
	content.setParentId( parentId );       
	// retrieve the content persister and persist the content item     
	ContentDbPersister persister = (ContentDbPersister) bbPm.getPersister( ContentDbPersister.TYPE ); 
	persister.persist( content ); 

}
 
开发者ID:mafudge,项目名称:EnsembleBuildingBlock,代码行数:23,代码来源:ContentCreator.java


示例9: getAdminCourses

import blackboard.data.course.Course; //导入依赖的package包/类
private Iterable<Command> getAdminCourses()
{
  try
  {
    List<Course> courses = CourseDbLoader.Default.getInstance().loadAllByServiceLevel( ServiceLevel.FULL );
    Set<Command> commands = Sets.newTreeSet();
    for ( Course course : courses )
    {
      String url = String.format( ADMIN_COURSE_URL_TEMPLATE, course.getId().toExternalString() );
      url = FramesetUtil.getTabGroupUrl(blackboard.data.navigation.Tab.TabType.courses, url);
      SimpleCommand command = new SimpleCommand( course.getTitle(), url, Category.COURSE );
      commands.add( command );
    }
    return commands;

  }
  catch ( PersistenceException e )
  {
    throw new PersistenceRuntimeException( e );
  }
}
 
开发者ID:blackboard,项目名称:hayabusa,代码行数:22,代码来源:CourseProvider.java


示例10: getMyCourses

import blackboard.data.course.Course; //导入依赖的package包/类
private Iterable<Command> getMyCourses( User user )
{
  try
  {
    List<Course> courses = CourseDbLoader.Default.getInstance().loadByUserId( user.getId() );
    Set<Command> commands = Sets.newTreeSet();
    for ( Course course : courses )
    {
      String url = String.format( My_COURSE_URL_TEMPLATE, course.getId().toExternalString() );
      url = FramesetUtil.getTabGroupUrl(blackboard.data.navigation.Tab.TabType.courses, url);
      SimpleCommand command = new SimpleCommand( course.getTitle(), url, Category.COURSE );
      commands.add( command );
    }
    return commands;
  }
  catch ( PersistenceException e )
  {
    throw new PersistenceRuntimeException( e );
  }
}
 
开发者ID:blackboard,项目名称:hayabusa,代码行数:21,代码来源:CourseProvider.java


示例11: parseValue

import blackboard.data.course.Course; //导入依赖的package包/类
@Override
public String parseValue(String value) {

  B2Context b2Context = this.getService().getB2Context();
  Course course = b2Context.getContext().getCourse();
  Content content = b2Context.getContext().getContent();
  if ((course != null) && (content != null)) {
    String url = this.getEndpoint();
    String contentId = content.getId().toExternalString();
    if (!content.getContentHandler().equals(Utils.getResourceHandle(b2Context, null))) {
      contentId += ":" + b2Context.getRequestParameter(Constants.TOOL_ID, "");
    }
    url = url.replaceAll("\\{link_id\\}", contentId);
    value = value.replaceAll("\\$LtiLink.custom.url", url);
  }

  return value;

}
 
开发者ID:ubc,项目名称:enhanced-basiclti-b2,代码行数:20,代码来源:LinkSetting.java


示例12: getSettingsString

import blackboard.data.course.Course; //导入依赖的package包/类
protected String getSettingsString(B2Context b2Context, String contextId) {

    String settingsString;
    try {
      String settingPrefix = Constants.TOOL_PARAMETER_PREFIX + "." + this.getService().getTool().getId() + "." + Constants.SERVICE_PARAMETER_PREFIX + "." + this.getService().getId() + ".custom";
      BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager();
      Id id = bbPm.generateId(Course.DATA_TYPE, contextId);
      b2Context.setContext(Resource.initContext(id, Id.UNSET_ID));
      b2Context.setIgnoreContentContext(true);
      settingsString = b2Context.getSetting(false, true, settingPrefix, "");
    } catch (PersistenceException e) {
      Logger.getLogger(ContextSetting.class.getName()).log(Level.SEVERE, null, e);
      settingsString = "";
    }

    return settingsString;

  }
 
开发者ID:ubc,项目名称:enhanced-basiclti-b2,代码行数:19,代码来源:ContextSetting.java


示例13: setSettingsString

import blackboard.data.course.Course; //导入依赖的package包/类
private boolean setSettingsString(B2Context b2Context, String contextId, String custom) {

    boolean ok = true;
    try {
      String settingPrefix = Constants.TOOL_PARAMETER_PREFIX + "." + this.getService().getTool().getId() + "." + Constants.SERVICE_PARAMETER_PREFIX + "." + this.getService().getId() + ".custom";
      BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager();
      Id id = bbPm.generateId(Course.DATA_TYPE, contextId);
      b2Context.setContext(Resource.initContext(id, Id.UNSET_ID));
      b2Context.setIgnoreContentContext(true);
      b2Context.setSetting(false, true, settingPrefix, custom);
      b2Context.persistSettings(false, true);
    } catch (PersistenceException e) {
      Logger.getLogger(ContextSetting.class.getName()).log(Level.SEVERE, null, e);
      ok = false;
    }

    return ok;

  }
 
开发者ID:ubc,项目名称:enhanced-basiclti-b2,代码行数:20,代码来源:ContextSetting.java


示例14: parseValue

import blackboard.data.course.Course; //导入依赖的package包/类
@Override
public String parseValue(String value) {

  Course course = this.getService().getB2Context().getContext().getCourse();
  if (course != null) {
    String url = this.getEndpoint();
    url = url.replaceAll("\\{context_type\\}", "CourseSection");
    url = url.replaceAll("\\{context_id\\}", course.getId().toExternalString());
    url = url.replaceAll("\\{vendor_code\\}", this.getService().getB2Context().getVendorId());
    url = url.replaceAll("\\{product_code\\}", this.getService().getTool().getId());
    value = value.replaceAll("\\$ToolProxyBinding.custom.url", url);
  }

  return value;

}
 
开发者ID:ubc,项目名称:enhanced-basiclti-b2,代码行数:17,代码来源:ContextSetting.java


示例15: initContext

import blackboard.data.course.Course; //导入依赖的package包/类
public static Context initContext(String course, String content) {

    Id courseId = Id.UNSET_ID;
    Id contentId = Id.UNSET_ID;
    try {
      if (course != null) {
        courseId = Id.generateId(Course.DATA_TYPE, course);
      }
      if (content != null) {
        contentId = Id.generateId(Content.DATA_TYPE, content);
      }
    } catch (PersistenceException e) {
    }

    return initContext(courseId, contentId);

  }
 
开发者ID:ubc,项目名称:enhanced-basiclti-b2,代码行数:18,代码来源:Utils.java


示例16: getLineitem

import blackboard.data.course.Course; //导入依赖的package包/类
/**
    * Finds lineitem by bbContentId, userId and lamsLessonId.
    * 
    * @throws ServletException
    * @throws PersistenceException
    */
   public static Lineitem getLineitem(String bbContentId, Id userId, String lamsLessonIdParam)
    throws ServletException, PersistenceException {
BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager();
CourseDbLoader courseLoader = CourseDbLoader.Default.getInstance();
LineitemDbLoader lineitemLoader = LineitemDbLoader.Default.getInstance();

// 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);

if (lineitemIdStr != null) {
    Id lineitemId = bbPm.generateId(Lineitem.LINEITEM_DATA_TYPE, lineitemIdStr.trim());
    return lineitemLoader.loadById(lineitemId);

    // 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)   
} else {

    // search for appropriate lineitem
    List<Course> userCourses = courseLoader.loadByUserId(userId);
    for (Course userCourse : userCourses) {
	List<Lineitem> lineitems = lineitemLoader.loadByCourseId(userCourse.getId());

	for (Lineitem lineitem : lineitems) {
	    if (lineitem.getAssessmentId() != null && lineitem.getAssessmentId().equals(lamsLessonIdParam)) {
		return lineitem;
	    }
	}
    }
}

return null;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:40,代码来源:LineitemUtil.java


示例17: addMembership

import blackboard.data.course.Course; //导入依赖的package包/类
public void addMembership(final Course course, final GroupMembership membership) {
    Collection<GroupMembership> memberships = this.unsafeMemberships.get(course);
    
    if (null == memberships) {
        memberships = new ArrayList<GroupMembership>();
        this.unsafeMemberships.put(course, memberships);
    }
    
    memberships.add(membership);
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:11,代码来源:UnsafeGroupMembershipManager.java


示例18: buildCourseId

import blackboard.data.course.Course; //导入依赖的package包/类
/**
 * Constructs a Learn course ID based on the given string. This is provided as
 * a method so that it can be overriden for unit testing.
 * 
 * @param id the string to convert to a course ID.
 * @return a course ID. Returns null if input is null.
 */
public Id buildCourseId(final String id) throws PersistenceException {
    if (null == id) {
        return null;
    }
    
    return Id.generateId(Course.DATA_TYPE, id);
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:15,代码来源:BlackboardService.java


示例19: addCourse

import blackboard.data.course.Course; //导入依赖的package包/类
/**
 * Add a course to the mock loader.
 * 
 * @param course course to be stored ready for loading.
 */
protected void addCourse(final Course course) {
    assert null != course;
    assert null != course.getId();
    assert null != course.getCourseId();
    
    this.courseById.put(course.getId(), course);
    this.courseByCourseId.put(course.getCourseId(), course);
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:14,代码来源:CourseMockLoader.java


示例20: loadById

import blackboard.data.course.Course; //导入依赖的package包/类
@Override
public Course loadById(Id id) throws KeyNotFoundException, PersistenceException {
    final Course course = this.courseById.get(id);
    
    if (null == course) {
        throw new KeyNotFoundException("Could not find course \""
            + id.getExternalString() + "\".");
    } else {
        return course;
    }
}
 
开发者ID:rnicoll,项目名称:learn_syllabus_plus_sync,代码行数:12,代码来源:CourseMockLoader.java



注:本文中的blackboard.data.course.Course类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DiffFunction类代码示例发布时间:2022-05-22
下一篇:
Java ScheduleItem类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap