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

Java CourseDbLoader类代码示例

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

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



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

示例1: getAdminCourses

import blackboard.persist.course.CourseDbLoader; //导入依赖的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


示例2: getMyCourses

import blackboard.persist.course.CourseDbLoader; //导入依赖的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


示例3: userReadByCourseIdAndCMRole

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBUser> userReadByCourseIdAndCMRole(BBCourse course, BBCourseMembershipRole cmRole, BBUserVerbosity verbosity) throws WebServiceException
  {
      List<BBUser> rl = new ArrayList<BBUser>();
      try
      {
          //This may require heavy loading instead of lightweight
          List<CourseMembership> cml = CourseMembershipDbLoader.Default.getInstance().loadByCourseIdAndRole(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId(),CourseMembership.Role.fromExternalString(cmRole.name()),null,true);
   if(cml.size()>0)
   {
Iterator<CourseMembership> i = cml.iterator();
while(i.hasNext())
{
    rl.add(ObjectConverter.getUser(i.next().getUser(),verbosity));
}
return rl;
   }
      }
      catch(Exception e)
      {
          throw new WebServiceException(e.getMessage());
      }
      return rl;
  }
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:24,代码来源:UserHelper.java


示例4: groupAdd

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static boolean groupAdd(BBGroup group, BBCourse course, String descType) throws WebServiceException
{
    try
    {
        Group g = new Group();
        g.setCourseId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseBbId()).getId());
        g.setDescription(new FormattedText(group.getDescription(),Type.fromFieldName(descType.trim().toUpperCase())));
        g.setIsAvailable(group.getAvailable());
        g.setIsChatRoomAvailable(group.getChatRoomsAvailable());
        g.setIsDiscussionBoardAvailable(group.getDiscussionBoardsAvailable());
        g.setIsEmailAvailable(group.getEmailAvailable());
        g.setIsTransferAreaAvailable(group.getTransferAreaAvailable());
        g.setTitle(group.getTitle());
        GroupDbPersister.Default.getInstance().persist(g);
    }
    catch(Exception e)
    {
        //return "Invalid description formatted text type, try: HTML/PLAIN_TEXT/SMART_TEXT";
        throw new WebServiceException("Error while trying to add group "+e.toString());
    }
    return true;
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:23,代码来源:GroupHelper.java


示例5: gradeCentreGradableItemReadByCourseId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBGradableItem> gradeCentreGradableItemReadByCourseId(BBCourse course) throws WebServiceException
{
    try
    {
        //return BBListFactory.getNonVerboseBBList(GradebookManagerFactory.getInstanceWithoutSecurityCheck().getGradebookItems(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId()));
        return BBListFactory.getNonVerboseBBList(GradableItemDAO.get().getGradableItemByCourse(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId()));
    }
    catch(EmptyListException ele)
    {
        throw new WebServiceException("No gradable items found");
    }
    catch(Exception e)
    {
        throw new WebServiceException("Error while retrieving GradableItems: "+e.toString());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:17,代码来源:GradeCentreHelper.java


示例6: gradeCentreLineitemAdd

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static boolean gradeCentreLineitemAdd(BBLineitem lineitem, BBCourse course) throws WebServiceException
{
    try
    {
        Lineitem li = new Lineitem();
        li.setCourseId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId());
        //li.setAssessmentLocation(Lineitem.AssessmentLocation.INTERNAL);
        li.setName(lineitem.getName());
        li.setIsAvailable(lineitem.getAvailable());
        li.setPointsPossible(lineitem.getPointsPossible());
        li.setType(lineitem.getType());
        li.setWeight(lineitem.getWeight());
        ((LineitemDbPersister)PersistenceServiceFactory.getInstance().getDbPersistenceManager().getPersister(LineitemDbPersister.TYPE)).persist(li);
    }
    catch(Exception e)
    {
        throw new WebServiceException("Error: Could not add lineitem "+e.toString());
    }
    return true;
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:21,代码来源:GradeCentreHelper.java


示例7: courseReadAll

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBCourse> courseReadAll(BBCourseVerbosity verbosity)
{
    try
    {
        if(verbosity == null)
        {
            throw new Exception("You must specify a verbosity level");
        }
        //return getBBCourseListFromList(CourseDbLoader.Default.getInstance().loadAllCourses(),verbosity);
        return BBListFactory.getBBCourseListFromList(CourseDbLoader.Default.getInstance().loadAllCourses(),verbosity);
    }
    catch(EmptyListException ele)
    {
        throw new WebServiceException("No courses found");
    }
    catch(Exception e)
    {
        throw new WebServiceException("Error whilst searching to see if course exists: "+e.toString());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:21,代码来源:CourseHelper.java


示例8: courseReadByUserIdAndCMRole

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBCourse> courseReadByUserIdAndCMRole(BBUser user, BBCourseMembershipRole cmRole, BBCourseVerbosity verbosity) throws WebServiceException
{
    try
    {
        if(verbosity == null)
        {
            throw new Exception("You must specify a verbosity level");
        }
        //return getBBCourseListFromList(CourseDbLoader.Default.getInstance().loadByUserIdAndCourseMembershipRole(UserDbLoader.Default.getInstance().loadByUserName(user.getUserName()).getId(),CourseMembership.Role.fromExternalString(cmRole.name())),verbosity);
        return BBListFactory.getBBCourseListFromList(CourseDbLoader.Default.getInstance().loadByUserIdAndCourseMembershipRole(UserDbLoader.Default.getInstance().loadByUserName(user.getUserName()).getId(),CourseMembership.Role.fromExternalString(cmRole.name())),verbosity);
    }
    catch(EmptyListException ele)
    {
        throw new WebServiceException("No courses found");
    }
    catch(Exception e)
    {
        throw new WebServiceException("Error whilst searching to see if course exists: "+e.toString());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:21,代码来源:CourseHelper.java


示例9: courseMembershipReadByCourseId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBCourseMembership> courseMembershipReadByCourseId(BBCourse course,BBCourseMembershipVerbosity verbosity, Boolean loadUser)
{
    try
    {
        if(verbosity == null)
        {
            throw new Exception("You must specify a verbosity level");
        }
        return BBListFactory.getBBCourseMembershipListFromList(CourseMembershipDbLoader.Default.getInstance().loadByCourseId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId(),null,loadUser),verbosity);
    }
    catch(EmptyListException ele)
    {
        throw new WebServiceException("No course memberships found");
    }
    catch(Exception e)
    {
        throw new WebServiceException(e.getMessage());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:20,代码来源:CourseMembershipHelper.java


示例10: courseMembershipReadByUserIdAndCourseId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static BBCourseMembership courseMembershipReadByUserIdAndCourseId(BBUser user, BBCourse course,BBCourseMembershipVerbosity verbosity, Boolean loadUser)
{
    try
    {
        if(verbosity == null)
        {
            throw new Exception("You must specify a verbosity level");
        }
        //return new BBCourseMembership(CourseMembershipDbLoader.Default.getInstance().loadByCourseAndUserId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId(),UserDbLoader.Default.getInstance().loadByUserName(user.getUserName()).getId(),null,loadUser),verbosity);
        return ObjectConverter.getCourseMembership(CourseMembershipDbLoader.Default.getInstance().loadByCourseAndUserId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId(),UserDbLoader.Default.getInstance().loadByUserName(user.getUserName()).getId(),null,loadUser),verbosity);
    }
    catch(Exception e)
    {
        throw new WebServiceException(e.getMessage());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:17,代码来源:CourseMembershipHelper.java


示例11: getLineitem

import blackboard.persist.course.CourseDbLoader; //导入依赖的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


示例12: getOldContextId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static String getOldContextId(B2Context b2Context, String contextIdType) {

    B2Context courseContext = new B2Context(b2Context.getRequest());
    courseContext.setIgnoreContentContext(true);

    String contextIds = "";
    String old = courseContext.getSetting(false, true, "x_courseid", "");
    if ((old.length() > 0) && !contextIdType.equals(Constants.DATA_COURSEID)) {
      StringBuilder contexts = new StringBuilder();
      try {
        BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager();
        CourseDbLoader courseLoader = (CourseDbLoader)bbPm.getLoader(CourseDbLoader.TYPE);
        String[] courses = old.split(",");
        Course course;
        Id courseId;
        String contextId;
        for (int i = 0; i < courses.length; i++) {
          courseId = Id.generateId(Course.DATA_TYPE, courses[i]);
          course = courseLoader.loadById(courseId);
          if (contextIdType.equals(Constants.DATA_PRIMARYKEY)) {
            contextId = course.getId().toExternalString();
          } else if (contextIdType.equals(Constants.DATA_UUID) && B2Context.getIsVersion(9, 1, 13)) {
            contextId = course.getUuid();
          } else {
            contextId = course.getBatchUid();
          }
          contexts.append(",").append(urlEncode(contextId));
        }
        contextIds = contexts.substring(1);
      } catch (PersistenceException ex) {
        Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
      }
    }

    return contextIds;

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


示例13: groupReadByCourseId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBGroup> groupReadByCourseId(BBCourse course) throws WebServiceException
{
    try
    {
        return BBListFactory.getNonVerboseBBList(GroupDbLoader.Default.getInstance().loadByCourseId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId()));
    }
    catch(EmptyListException ele)
    {
        throw new WebServiceException("No groups found");
    }
    catch(Exception e)
    {
        throw new WebServiceException(e.getMessage());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:16,代码来源:GroupHelper.java


示例14: announcementReadByCourseId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBAnnouncement> announcementReadByCourseId(BBCourse course) throws WebServiceException
{
    try
    {
         return BBListFactory.getNonVerboseBBList(AnnouncementDbLoader.Default.getInstance().loadByCourseId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId()));
    }
    catch(EmptyListException ele)
    {
        throw new WebServiceException("No announcements found");
    }
    catch(Exception e)
    {
        throw new WebServiceException(e.getMessage());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:16,代码来源:AnnouncementHelper.java


示例15: roleUserReadByUserIdAndCourseId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static BBRole roleUserReadByUserIdAndCourseId(BBUser user, BBCourse course) throws WebServiceException
{
    try
    {
        return ObjectConverter.getRole(CourseMembershipDbLoader.Default.getInstance().loadByCourseAndUserId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId(),UserDbLoader.Default.getInstance().loadByUserName(user.getUserName()).getId()));
    }
    catch(Exception e)
    {
        throw new WebServiceException(e.getMessage());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:12,代码来源:RoleHelper.java


示例16: gradeCentreGradingSchemaReadByCourseId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBGradingSchema> gradeCentreGradingSchemaReadByCourseId(BBCourse course) throws WebServiceException
{
    try
    {
        return BBListFactory.getNonVerboseBBList(GradebookManagerFactory.getInstanceWithoutSecurityCheck().getGradingSchemaForCourse(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId()));
    }
    catch(EmptyListException ele)
    {
        throw new WebServiceException("No gradable items found");
    }
    catch(Exception e)
    {
        throw new WebServiceException("Error: "+e.getMessage());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:16,代码来源:GradeCentreHelper.java


示例17: gradeCentreLineitemReadByCourseId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBLineitem> gradeCentreLineitemReadByCourseId(BBCourse course, BBLineitemVerbosity verbosity) throws WebServiceException
{
    try
    {
        return BBListFactory.getBBLineitemListFromList((((LineitemDbLoader)PersistenceServiceFactory.getInstance().getDbPersistenceManager().getLoader(LineitemDbLoader.TYPE)).loadByCourseId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId())),verbosity);
    }
    catch(EmptyListException ele)
    {
        throw new WebServiceException("No line items found");
    }
    catch(Exception e)
    {
        throw new WebServiceException(e.getMessage());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:16,代码来源:GradeCentreHelper.java


示例18: gradeCentreOutcomeDefinitionReadByCourseId

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static List<BBOutcomeDefinition> gradeCentreOutcomeDefinitionReadByCourseId(BBCourse course) throws WebServiceException
{
    try
    {
        return BBListFactory.getNonVerboseBBList(((OutcomeDefinitionDbLoader)PersistenceServiceFactory.getInstance().getDbPersistenceManager().getLoader(OutcomeDefinitionDbLoader.TYPE)).loadByCourseId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId()));
    }
    catch(EmptyListException ele)
    {
        throw new WebServiceException("No outcome definitions found");
    }
    catch(Exception e)
    {
        throw new WebServiceException(e.getMessage());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:16,代码来源:GradeCentreHelper.java


示例19: gradeCentreSettingsRead

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static BBGradeCentreSettings gradeCentreSettingsRead(BBCourse course) throws WebServiceException
{
    try
    {
        return ObjectConverter.getGradeCentreSettings(GradeBookSettingsDbLoader.Default.getInstance().loadByCourseId(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseBbId()).getId()));
    }
    catch(Exception e)
    {
        throw new WebServiceException(e.getMessage());
    }
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:12,代码来源:GradeCentreHelper.java


示例20: courseDelete

import blackboard.persist.course.CourseDbLoader; //导入依赖的package包/类
public static boolean courseDelete(BBCourse course)
{
    String error = "";
    try
    {
        if(Util.checkParam(course.getCourseId()))
        {
            CourseDbPersister.Default.getInstance().deleteById(CourseDbLoader.Default.getInstance().loadByCourseId(course.getCourseId()).getId());
            return true;
        }
        else if(Util.checkParam(course.getCourseBbId()))
        {
            CourseDbPersister.Default.getInstance().deleteById(CourseDbLoader.Default.getInstance().loadById(PersistenceServiceFactory.getInstance().getDbPersistenceManager().generateId(Course.DATA_TYPE,course.getCourseBbId())).getId());
            return true;
        }
        error = "You must specify either courseId or courseBBId";
    }
    catch(KeyNotFoundException knfe)
    {
        error = "No matching course";
    }
    catch(Exception e)
    {
        error = "Error whilst deleting course: "+e.toString();
    }
    throw new WebServiceException(error);
}
 
开发者ID:andmar8,项目名称:Blackboard-Java-WebservicesBBHelper,代码行数:28,代码来源:CourseHelper.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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