Package org.olat.properties

Examples of org.olat.properties.Property


    }
    return null;
  }
 
  public void saveProjectBrokerId(Long projectBrokerId, CoursePropertyManager cpm, CourseNode courseNode) {
    Property projectBrokerKeyProperty = cpm.createCourseNodePropertyInstance(courseNode, null, null, ProjectBrokerCourseNode.CONF_PROJECTBROKER_KEY, null, projectBrokerId, null, null);
    cpm.saveProperty(projectBrokerKeyProperty)
  }
View Full Code Here


   * @param courseExportPath
   * @param re
   */
  private void markAsDeployed(String courseExportPath, RepositoryEntry re) {
    PropertyManager pm = PropertyManager.getInstance();
    Property prop = pm.createPropertyInstance(null, null, null, "_o3_", "deployedCourses", null, re.getKey(), courseExportPath, null);
    pm.saveProperty(prop);
    deplyedCoursePaths.put(courseExportPath, re);
  }
View Full Code Here

    if (deplyedCoursePaths != null) return deplyedCoursePaths;
    PropertyManager pm = PropertyManager.getInstance();
    List props = pm.findProperties(null, null, null, "_o3_", "deployedCourses");
    deplyedCoursePaths = new HashMap(props.size());
    for (Iterator iter = props.iterator(); iter.hasNext();) {
      Property prop = (Property) iter.next();
      Long repoKey = prop.getLongValue();
      RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(repoKey);
      if (re != null) deplyedCoursePaths.put(prop.getStringValue(), re);
    }
    return deplyedCoursePaths;
  }
View Full Code Here

    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();
      String limitedLogContent = createLimitedLogContent(newLog,60000);
      logProperty.setTextValue(limitedLogContent);
      cpm.updateProperty(logProperty);
    }

  }
View Full Code Here

   *      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

    // generate the random alpha numeric token
    String token = RandomStringUtils.randomAlphanumeric(6);
   
    // save token as a property of resourceable
    NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(resourceable);
    Property tokenProperty = npm.createPropertyInstance(identity, null,
        PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN, null, null, token, null );
    npm.saveProperty(tokenProperty);
   
    //return the token generated
    return token;
View Full Code Here

    // generate the random alpha numeric token
    String token = RandomStringUtils.randomAlphabetic(6);
   
     // save token as a property of resourceable
    PropertyManager pm = PropertyManager.getInstance();
    Property tokenProperty = pm.createPropertyInstance(identity, null,
        null, PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN, null, null, token, null );
    pm.saveProperty(tokenProperty);
   
    //return the generated token
    return token;
View Full Code Here

  }
 
  private static String getIcalAuthToken(OLATResourceable resourceable, Identity identity, boolean create) {
    // find the property for the resourceable
    NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(resourceable);
    Property tokenProperty = npm.findProperty(identity, null,
        PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
   
    String token; 
    if (tokenProperty == null && create) {
      token = createIcalAuthToken(resourceable, identity);
    } else {
      token = tokenProperty.getStringValue();
    }
   
    // return the string value for the property
    return token;
  }
View Full Code Here

  }
 
  private static String getIcalAuthToken(Identity identity, boolean create) {
    // find the property for the identity
    PropertyManager pm = PropertyManager.getInstance();
    Property tokenProperty = pm.findProperty(identity, null, null,
        PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
   
    String token;
    if (tokenProperty == null && create) {
      token = createIcalAuthToken(identity);
    } else {
      token = tokenProperty.getStringValue();
    }
   
    // return the string value for the property
    return token;
  }
View Full Code Here

  }
 
  private static String regenerateIcalAuthToken(OLATResourceable resourceable, Identity identity) {
    // find the property for the resourceable
    NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(resourceable);
    Property tokenProperty = npm.findProperty(identity, null,
        PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
   
    //genearate the new token
    String authToken = RandomStringUtils.randomAlphanumeric(6);
   
    //set new auth token as the string value of the property
    tokenProperty.setStringValue(authToken);
   
    // update the property
    npm.updateProperty(tokenProperty);
   
    //return the new token
View Full Code Here

TOP

Related Classes of org.olat.properties.Property

Copyright © 2018 www.massapicom. 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.