Examples of CoursePropertyManager


Examples of org.olat.course.properties.CoursePropertyManager

   * @see org.olat.course.assessment.AssessmentManager#saveScoreEvaluation(org.olat.course.nodes.CourseNode, org.olat.core.id.Identity, org.olat.core.id.Identity, org.olat.course.run.scoring.ScoreEvaluation)
   */
  public void saveScoreEvaluation(final CourseNode courseNode, final Identity identity, final Identity assessedIdentity, final ScoreEvaluation scoreEvaluation,
      final UserCourseEnvironment userCourseEnv, final boolean incrementUserAttempts) {
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    // o_clusterREVIEW we could sync on a element finer than course, e.g. the composite course+assessIdentity.
    // +: concurrency would be higher
    // -: many entries (num of courses * visitors of given course) in the locktable.
    // we could also sync on the assessedIdentity.
   
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

   * @param wrappedIdentity
   * @return
   */
  private String getStatusFor(AssessableCourseNode courseNode, AssessedIdentityWrapper wrappedIdentity) {
   
    CoursePropertyManager cpm = wrappedIdentity.getUserCourseEnvironment().getCourseEnvironment().getCoursePropertyManager();
    Property statusProperty;
    Translator trans = Util.createPackageTranslator(StatusForm.class, getLocale());
    statusProperty = cpm.findCourseNodeProperty(courseNode, wrappedIdentity.getIdentity(), null, StatusManager.PROPERTY_KEY_STATUS);
    if (statusProperty == null) {
      String value = trans.translate(StatusForm.PROPERTY_KEY_UNDEFINED);
      return value;
    } else {
      String value = trans.translate(StatusForm.STATUS_LOCALE_PROPERTY_PREFIX + statusProperty.getStringValue());
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

    if (samples.size() == 0) return null; // no sample assigned yet
    return ((Property)samples.get(0)).getStringValue();
  }

  private void setAssignedTask(Identity identity, String task) {
    CoursePropertyManager cpm = courseEnv.getCoursePropertyManager();
    Property p = cpm.createCourseNodePropertyInstance(node, identity, null, PROP_ASSIGNED, null, null, task, null);
    cpm.saveProperty(p);
  }
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

    Property p = cpm.createCourseNodePropertyInstance(node, identity, null, PROP_ASSIGNED, null, null, task, null);
    cpm.saveProperty(p);
  }
 
  private void markTaskAsSampled(String task) {
    CoursePropertyManager cpm = courseEnv.getCoursePropertyManager();
    Property p = cpm.createCourseNodePropertyInstance(node, null, null, PROP_SAMPLED, null, null, task, null);
    cpm.saveProperty(p);
  }
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 fDropboxFolder = new File(FolderConfig.getCanonicalRoot() + DropboxController.getDropboxPathRelToFolderRoot(course.getCourseEnvironment(), this));
    if (fDropboxFolder.exists() && fDropboxFolder.list().length > 0) return trans.translate(NLS_WARN_NODEDELETE); // Dropbox folder contains files
    File fReturnboxFolder = new File(FolderConfig.getCanonicalRoot() + ReturnboxController.getReturnboxPathRelToFolderRoot(course.getCourseEnvironment(), this));
    if (fReturnboxFolder.exists() && fReturnboxFolder.list().length > 0) return trans.translate(NLS_WARN_NODEDELETE); // Returnbox folder contains files
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 cpm = course.getCourseEnvironment().getCoursePropertyManager();
    Long projectBrokerId = ProjectBrokerManagerFactory.getProjectBrokerManager().getProjectBrokerId(cpm, this);
    File fDropBox = new File(FolderConfig.getCanonicalRoot() + DropboxController.getDropboxPathRelToFolderRoot(course.getCourseEnvironment(), this));
    if (fDropBox.exists()) FileUtils.deleteDirsAndFiles(fDropBox, true, true);
    File fReturnBox = new File(FolderConfig.getCanonicalRoot() + ReturnboxController.getReturnboxPathRelToFolderRoot(course.getCourseEnvironment(), this));
    if (fReturnBox.exists()) FileUtils.deleteDirsAndFiles(fReturnBox, true, true);
    File attachmentDir = new File(FolderConfig.getCanonicalRoot() + ProjectBrokerManagerFactory.getProjectBrokerManager().getAttachmentBasePathRelToFolderRoot(course.getCourseEnvironment(), this));
    if (attachmentDir.exists()) FileUtils.deleteDirsAndFiles(attachmentDir, true, true);
    // Delete project-broker, projects and project-groups
    if (projectBrokerId != null) {
      ProjectBrokerManagerFactory.getProjectBrokerManager().deleteProjectBroker(projectBrokerId, course.getCourseEnvironment(), this);
    }
    // Delete all properties...
    cpm.deleteNodeProperties(this, null);
  }
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

   *      org.olat.core.gui.control.WindowControl)
   */
  @Override
  public Controller importNode(File importDirectory, ICourse course, boolean unattendedImport, UserRequest ureq, WindowControl wControl) {
    ProjectBroker projectBroker = ProjectBrokerManagerFactory.getProjectBrokerManager().createAndSaveProjectBroker();
    CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    ProjectBrokerManagerFactory.getProjectBrokerManager().saveProjectBrokerId(projectBroker.getKey(), cpm, this);
   
    return null;
  }
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

    Translator translator = new PackageTranslator(PACKAGE, locale);
    StringBuilder table = new StringBuilder();
    ProjectBrokerModuleConfiguration moduleConfig = new ProjectBrokerModuleConfiguration(courseNode.getModuleConfiguration());

    // load project-list
    CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    Long projectBrokerId = ProjectBrokerManagerFactory.getProjectBrokerManager().getProjectBrokerId(cpm, courseNode);
    if (projectBrokerId == null) {
      throw new AssertException("Could not found project-broker-id in ModuleConfiguration courseNode=" + courseNode);
    }
    List<Project> projects = ProjectBrokerManagerFactory.getProjectBrokerManager().getProjectListBy(projectBrokerId)
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager

    Translator fallbackTranslator = new PackageTranslator(Util.getPackageName(DropboxForm.class), ureq.getLocale(), new PackageTranslator(Util.getPackageName(MSCourseNodeEditController.class), ureq.getLocale()));
    Translator myTranslator = new PackageTranslator( Util.getPackageName(ProjectBrokerCourseEditorController.class), ureq.getLocale(),  fallbackTranslator);
    setTranslator(myTranslator);

    // check if a project-broker exists
    CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    Long projectBrokerId = ProjectBrokerManagerFactory.getProjectBrokerManager().getProjectBrokerId(cpm, node);
    if (projectBrokerId == null) {
      // no project-broker exist => create a new one, happens only once
      ProjectBroker projectBroker = ProjectBrokerManagerFactory.getProjectBrokerManager().createAndSaveProjectBroker();
      projectBrokerId = projectBroker.getKey();
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.