Package org.olat.properties

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


  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 {
      final long result = p.getLongValue();
      p.setLongValue(lastUpdated);
      pm.saveProperty(p);
View Full Code Here


      pm.saveProperty(newp);
      return -1;
    } else {
      final long result = p.getLongValue();
      p.setLongValue(lastUpdated);
      pm.saveProperty(p);
      return result;
    }
  }
 
  @Override
View Full Code Here

  private void addQTIEditorSessionLock(FileResource fr, Identity user){
    PropertyManager pm = PropertyManager.getInstance();
    String derivedLockString = OresHelper.createStringRepresenting(fr);
    Property newp = pm.createPropertyInstance(null, null, null, "o_lock", derivedLockString, null, user.getKey(), null, null);
    pm.saveProperty(newp);
  }
 
 
  public String getVersion() {
    return VERSION;
View Full Code Here

  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

  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);
      pm.updateProperty(property);
    }
  }
View Full Code Here

   * @param identity
   */
  public void setHasConfirmedDislaimer(Identity identity) {   
    PropertyManager propertyMgr = PropertyManager.getInstance();
    Property disclaimerProperty = propertyMgr.createUserPropertyInstance(identity, "user", "dislaimer_accepted", null, 1l, null, null);
    propertyMgr.saveProperty(disclaimerProperty);
  }

  /**
   * Remove all disclaimer confirmations. This means that every user on the
   * system must accept the disclaimer again.
View Full Code Here

        } else {
          // if existing -> update to desired value
          property.setStringValue(toolValueStr);
        }
        // property becomes persistent
        pm.saveProperty(property);
      }});
    this.dirty = true;
    cacheToolStates.put(selectedTool, Boolean.valueOf(toolValue));
  }
View Full Code Here

      // generate x-stream serialization of this object
      String props = XStreamHelper.toXML(this);
      if (this.dbProperty == null) {
        // save as new property
        this.dbProperty = pm.createPropertyInstance(owner, null, null, null, DbStorage.USER_PROPERTY_KEY, null, null, null, props);
        pm.saveProperty(this.dbProperty);
      } else {
        // update exising property
        this.dbProperty.setTextValue(props);
        pm.updateProperty(this.dbProperty);
      }
View Full Code Here

   
    // make the entry in the database
    long timestamp = System.currentTimeMillis();
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.createUserPropertyInstance(ureq.getIdentity(), PROP_CATEGORY, sanitize(calendarName), null, timestamp, importUrl, null);
    pm.saveProperty(p);
  }
 
  /**
   * Delete an imported calendar
   *  1. remove the entry from the database
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.