Examples of CoursePropertyManager


Examples of org.olat.course.properties.CoursePropertyManager

   * @throws IOException
   */
  private void doIndexForum(SearchResourceContext parentResourceContext, ICourse course, CourseNode courseNode, OlatFullIndexer indexWriter) throws IOException,InterruptedException  {
    if (log.isDebug()) log.debug("Index Course Forum...");
    ForumManager fom = ForumManager.getInstance();
    CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();

    Property forumKeyProperty = cpm.findCourseNodeProperty(courseNode, null, null, FOCourseNode.FORUM_KEY);
    // Check if forum-property exist
    if (forumKeyProperty != null) {
      Long forumKey = forumKeyProperty.getLongValue();
      Forum forum = fom.loadForum(forumKey);
//      SearchResourceContext forumSearchResourceContext = new SearchResourceContext(parentResourceContext);
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

   *      org.olat.course.ICourse)
   */
  @Override
  public String informOnDelete(Locale locale, ICourse course) {
    Translator trans = new PackageTranslator(PACKAGE_TA, locale);
    CoursePropertyManager cpm = PersistingCoursePropertyManager.getInstance(course);
    List list = cpm.listCourseNodeProperties(this, null, null, null);
    if (list.size() != 0) return trans.translate("warn.nodedelete"); // properties exist
    File fTaskFolder = new File(FolderConfig.getCanonicalRoot() + TACourseNode.getTaskFolderPathRelToFolderRoot(course, this));
    if (fTaskFolder.exists() && fTaskFolder.list().length > 0) return trans.translate(NLS_WARN_NODEDELETE); // task folder contains files
    return null; // no data yet.
  }
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

   * @see org.olat.course.nodes.CourseNode#cleanupOnDelete(
   *      org.olat.course.ICourse)
   */
  @Override
  public void cleanupOnDelete(ICourse course) {
    CoursePropertyManager pm = course.getCourseEnvironment().getCoursePropertyManager();
    // Delete all properties...
    pm.deleteNodeProperties(this, null);
    File fTaskFolder = new File(FolderConfig.getCanonicalRoot() + TACourseNode.getTaskFolderPathRelToFolderRoot(course, this));
    if (fTaskFolder.exists()) FileUtils.deleteDirsAndFiles(fTaskFolder, true, true);
    File fDropBox = new File(FolderConfig.getCanonicalRoot() + DropboxController.getDropboxPathRelToFolderRoot(course.getCourseEnvironment(), this));
    if (fDropBox.exists()) FileUtils.deleteDirsAndFiles(fDropBox, true, true);   
  }
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getDetailsListView(org.olat.course.run.userview.UserCourseEnvironment)
   */
  public String getDetailsListView(UserCourseEnvironment userCourseEnvironment) {
    Identity identity = userCourseEnvironment.getIdentityEnvironment().getIdentity();
    CoursePropertyManager propMgr = userCourseEnvironment.getCourseEnvironment().getCoursePropertyManager();
    List samples = propMgr.findCourseNodeProperties(this, identity, null, TaskController.PROP_ASSIGNED);
    if (samples.size() == 0) return null; // no sample assigned yet
    return ((Property) samples.get(0)).getStringValue();
  }
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

   * @see org.olat.course.nodes.CourseNode#informOnDelete(org.olat.core.gui.UserRequest,
   *      org.olat.course.ICourse)
   */
  @Override
  public String informOnDelete(Locale locale, ICourse course) {
    CoursePropertyManager cpm = PersistingCoursePropertyManager.getInstance(course);
    List list = cpm.listCourseNodeProperties(this, null, null, null);
    if (list.size() == 0) return null; // no properties created yet
    Translator trans = new PackageTranslator(PACKAGE_MS, locale);
    return trans.translate("warn.nodedelete");
  }
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

   * @see org.olat.course.nodes.CourseNode#cleanupOnDelete(
   *      org.olat.course.ICourse)
   */
  @Override
  public void cleanupOnDelete(ICourse course) {
    CoursePropertyManager pm = course.getCourseEnvironment().getCoursePropertyManager();
    // Delete all properties: score, passed, log, comment, coach_comment
    pm.deleteNodeProperties(this, null);
  }
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

   *
   * @param ident The current Subject
   */
  public void loadStatusFormData(StatusForm statusForm, CourseNode node, UserCourseEnvironment userCourseEnv) {
    Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
    CoursePropertyManager cpm = userCourseEnv.getCourseEnvironment().getCoursePropertyManager();
    Property statusProperty;

    statusProperty = cpm.findCourseNodeProperty(node, identity, null, PROPERTY_KEY_STATUS);
    if (statusProperty == null) {
      // found no status property => init DEFAULT value
      statusForm.setSelectedStatus(StatusForm.STATUS_VALUE_INITIAL);
    } else {
      String value = statusProperty.getStringValue();
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

  public void saveStatusFormData(StatusForm statusForm, CourseNode node, UserCourseEnvironment userCourseEnv) {
    Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
    String selectedKey = statusForm.getSelectedStatus();
   
    CoursePropertyManager cpm = userCourseEnv.getCourseEnvironment().getCoursePropertyManager();
    Property statusProperty;

    statusProperty = cpm.findCourseNodeProperty(node, identity, null, PROPERTY_KEY_STATUS);
    if (statusProperty == null) {
      statusProperty = cpm.createCourseNodePropertyInstance(node, identity, null, PROPERTY_KEY_STATUS, null, null,selectedKey, null);
      cpm.saveProperty(statusProperty);
    } else {
      statusProperty.setStringValue(selectedKey);
      cpm.updateProperty(statusProperty);
    }   
  }
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

  /**
   * @see org.olat.course.nodes.CourseNode#cleanupOnDelete(org.olat.course.ICourse)
   */
  public void cleanupOnDelete(ICourse course) {
    CoursePropertyManager pm = course.getCourseEnvironment().getCoursePropertyManager();
    // 1) Delete all properties: attempts
    pm.deleteNodeProperties(this, null);
    // 2) Delete all qtiresults for this node
    String repositorySoftKey = (String) getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
    Long repKey = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, true).getKey();
    QTIResultManager.getInstance().deleteAllResults(course.getResourceableId(), this.getIdent(), repKey);
  }
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

  /**
   * @see org.olat.course.nodes.CourseNode#cleanupOnDelete(org.olat.course.ICourse)
   */
  public void cleanupOnDelete(ICourse course) {
    super.cleanupOnDelete(course);
    CoursePropertyManager cpm = PersistingCoursePropertyManager.getInstance(course);
    cpm.deleteNodeProperties(this, PROPERTY_INITIAL_ENROLLMENT_DATE);
    cpm.deleteNodeProperties(this, PROPERTY_RECENT_ENROLLMENT_DATE);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.