Examples of findCourseNodeProperty()


Examples of org.olat.course.properties.CoursePropertyManager.findCourseNodeProperty()

    // But it seems like this mechanism is a bit unobvious and might well be worth some refactoring...
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerExecutor(){
      public void execute() {
        Property attemptsProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, ATTEMPTS);
        if (attemptsProperty == null) {
          attemptsProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, ATTEMPTS,
              null, new Long(attempts.intValue()), null, null);
          cpm.saveProperty(attemptsProperty);
        } else {
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager.findCourseNodeProperty()

  public void saveNodeComment(final CourseNode courseNode, final Identity identity, final Identity assessedIdentity, final String comment) {
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerExecutor(){
      public void execute() {
        Property commentProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, COMMENT);
        if (commentProperty == null) {
          commentProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, COMMENT, null, null, null, comment);
          cpm.saveProperty(commentProperty);
        } else {
          commentProperty.setTextValue(comment);
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager.findCourseNodeProperty()

  public void saveNodeCoachComment(final CourseNode courseNode, final Identity assessedIdentity, final String comment) {
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerExecutor(){
      public void execute() {
        Property commentProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, COACH_COMMENT);
        if (commentProperty == null) {
          commentProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, COACH_COMMENT, null, null, null, comment);
          cpm.saveProperty(commentProperty);
        } else {
          commentProperty.setTextValue(comment);
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager.findCourseNodeProperty()

  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.findCourseNodeProperty()

    StringBuilder sb = new StringBuilder();
    sb.append(LOG_DELIMITER);
    sb.append("Date: ").append(date).append("\n");
    sb.append("User: ").append(identity.getName()).append("\n");
    sb.append(logText).append("\n");
    Property logProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, LOG_IDENTIFYER);
    if (logProperty == null) {
      logProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, LOG_IDENTIFYER, null, null, null, sb.toString());
      cpm.saveProperty(logProperty);
    } else {
      String newLog = logProperty.getTextValue() + sb.toString();
View Full Code Here

Examples of org.olat.course.properties.CoursePropertyManager.findCourseNodeProperty()

   *      org.olat.core.id.Identity)
   */
  public String getUserNodeLog(CourseNode courseNode, Identity identity) {
    ICourse course = CourseFactory.loadCourse(ores);
    CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    Property property = cpm.findCourseNodeProperty(courseNode, identity, null, LOG_IDENTIFYER);
    if (property == null) return null;
    String result = property.getTextValue();
    return result;
  }

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.