Package org.olat.properties

Examples of org.olat.properties.PropertyManager.findProperty()


      OLATResourceable resourceable = getResourceable(calendarType, calendarID);
      NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(resourceable);
      tokenProperty = npm.findProperty(identity, null, PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
    } else {
      PropertyManager pm = PropertyManager.getInstance();
      tokenProperty = pm.findProperty(identity, null, null, PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
    }
    return tokenProperty != null;
   }
}
View Full Code Here


  }

  @Override
  public long getLastUpdated() {
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, STATISTICS_PROPERTIES_CATEGORY, LAST_UPDATED_PROPERTY_NAME);
    if (p==null) {
      return -1;
    } else {
      return p.getLongValue();
    }
View Full Code Here

  }
 
  @Override
  public long getAndUpdateLastUpdated(long lastUpdated) {
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, STATISTICS_PROPERTIES_CATEGORY, LAST_UPDATED_PROPERTY_NAME);
    if (p==null) {
      Property newp = pm.createPropertyInstance(null, null, null, STATISTICS_PROPERTIES_CATEGORY, LAST_UPDATED_PROPERTY_NAME, null, lastUpdated, null, null);
      pm.saveProperty(newp);
      return -1;
    } else {
View Full Code Here

   * @param defaultValue value that is used when no value exists so far
   * @return String value of this property or default value when no value exists
   */
  public String findOrCreateProperty(Class clazz, String propertyName, String defaultValue) {
    PropertyManager pm = PropertyManager.getInstance();
    Property property = pm.findProperty(null, null, null, PROPERTY_CATEGORY, createPropertyName(clazz, propertyName));
    if (property == null) {
      property = pm.createPropertyInstance(null, null, null, PROPERTY_CATEGORY, createPropertyName(clazz, propertyName), null, null, defaultValue, null);
      pm.saveProperty(property);
    }
    return property.getStringValue();
View Full Code Here

   * @param propertyName Name of the property
   * @param updateValue value that is used when no value exists so far
   */
  public void setProperty(Class clazz, String propertyName, String updateValue) {
    PropertyManager pm = PropertyManager.getInstance();
    Property property = pm.findProperty(null, null, null, PROPERTY_CATEGORY, createPropertyName(clazz, propertyName));
    if (property == null) {
      property = pm.createPropertyInstance(null, null, null, PROPERTY_CATEGORY, createPropertyName(clazz, propertyName), null, null, updateValue, null);
      pm.saveProperty(property);
    } else {
      property.setStringValue(updateValue);
View Full Code Here

    cacheToolStates.put(selectedTool, Boolean.valueOf(toolValue));
  }

  Property getPropertyOf(String selectedTool) {
    PropertyManager pm = PropertyManager.getInstance();
    Property property = pm.findProperty(null, null, ores, PROP_CAT_BG_COLLABTOOLS, selectedTool);
    Boolean res;
    if (property == null) { // meaning false
      res = Boolean.FALSE;
    } else {
      String val = property.getStringValue();
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.