Package org.olat.properties

Examples of org.olat.properties.PropertyManager


   * Delete all efficiency statements from the given course for all users
   * @param courseRepoEntryKey
   * @return int number of deleted efficiency statements
   */
  public void deleteEfficiencyStatementsFromCourse(Long courseRepoEntryKey) {
    PropertyManager pm = PropertyManager.getInstance();
    pm.deleteProperties(null, null, null, PROPERTY_CATEGORY, getPropertyName(courseRepoEntryKey));
  }
View Full Code Here


   * Delete the given efficiency statement for this person
   * @param identity
   * @param efficiencyStatement
   */
  protected void deleteEfficiencyStatement(Identity identity, EfficiencyStatement efficiencyStatement) {
    PropertyManager pm = PropertyManager.getInstance();
    String crourseRepoEntryKey = getPropertyName(efficiencyStatement.getCourseRepoEntryKey());
    pm.deleteProperties(identity, null, null, PROPERTY_CATEGORY, crourseRepoEntryKey);
  }
View Full Code Here

    OLATResourceable ores = OresHelper.createOLATResourceableInstance(INFO_MSG, KEY);
   
    CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor(){

      public void execute() {
        PropertyManager pm = PropertyManager.getInstance();
        Property p = pm.findProperty(null, null, null, "_o3_", INFO_MSG);
        if (p == null) {
          p =  pm.createPropertyInstance(null,  null,  null,  "_o3_", INFO_MSG, null, null, null, "");
          pm.saveProperty(p);
        }
        p.setTextValue(message);
        //set Message in RAM
        InfoMessageManager.infoMessage = message;
        pm.updateProperty(p);
      }
     
    });//end syncerCallback
    EventBus eb = CoordinatorManager.getCoordinator().getEventBus();
    MultiUserEvent mue = new MultiUserEvent(message);
View Full Code Here

    OLATResourceable ores = OresHelper.createOLATResourceableInstance(INFO_MSG, KEY);
   
    return CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerCallback<Property>() {
   
      public Property execute() {
      PropertyManager pm = PropertyManager.getInstance();
      Property p = pm.findProperty(null, null, null, "_o3_", key);
      if (p == null) {
        p =  pm.createPropertyInstance(null,  null,  null,  "_o3_", key, null, null, null, "");
        pm.saveProperty(p);
      }
      return p;
      }
     
    });//end syncerCallback
View Full Code Here

  /**
   * set info message on node level only, no need to sync
   * @param message
   */
  public void setInfoMessageNodeOnly(String message) {
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, "_o3_", INFO_MSG_NODE_ONLY+nodeId);
    if (p == null) {
      p =  pm.createPropertyInstance(null,  null,  null,  "_o3_", INFO_MSG_NODE_ONLY+nodeId, null, null, null, "");
      pm.saveProperty(p);
    }
    p.setTextValue(message);
    //set Message in RAM
    InfoMessageManager.infoMessageNodeOnly = message;
    pm.updateProperty(p);
  }
View Full Code Here

    defaultQuotas.put(QuotaConstants.IDENTIFIER_DEFAULT_NODES, defaultQuotaNodeFolder);
  }

  private Quota initDefaultQuota(String quotaIdentifier) {
    Quota q = null;
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, quotaResource, QUOTA_CATEGORY, quotaIdentifier);
    if (p != null) q = parseQuota(p);
    if (q != null) return q;
    // initialize default quota
    q = createQuota(quotaIdentifier, new Long(FolderConfig.getDefaultQuotaKB()), new Long(FolderConfig.getLimitULKB()));
    setCustomQuotaKB(q);
View Full Code Here

   */
  public Quota getCustomQuota(String path) {
    if (defaultQuotas == null) {
      throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null);
    }
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, quotaResource, QUOTA_CATEGORY, path);
    if (p == null) return null;
    else return parseQuota(p);
  }
View Full Code Here

   */
  public void setCustomQuotaKB(Quota quota) {
    if (defaultQuotas == null) {
      throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null);
    }
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, quotaResource, QUOTA_CATEGORY, quota.getPath());
    if (p == null) { // create new entry
      p = pm.createPropertyInstance(null, null, quotaResource, QUOTA_CATEGORY, quota.getPath(), null, null, assembleQuota(quota), null);
      pm.saveProperty(p);
    } else {
      p.setStringValue(assembleQuota(quota));
      pm.updateProperty(p);
    }
    // if the quota is a default quota, rebuild the default quota list
    if (quota.getPath().startsWith(QuotaConstants.IDENTIFIER_DEFAULT)) {
      initDefaultQuotas();
    }
View Full Code Here

    }
    // do not allow to delete default quotas!
    if (quota.getPath().startsWith(QuotaConstants.IDENTIFIER_DEFAULT)) {
      return false;
    }
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, quotaResource, QUOTA_CATEGORY, quota.getPath());
    if (p != null) pm.deleteProperty(p);
    return true;
  }
View Full Code Here

  public List listCustomQuotasKB() {
    if (defaultQuotas == null) {
      throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null);
    }
    List results = new ArrayList();
    PropertyManager pm = PropertyManager.getInstance();
    List props = pm.listProperties(null, null, quotaResource, QUOTA_CATEGORY, null);
    if (props == null || props.size() == 0) return results;
    for (Iterator iter = props.iterator(); iter.hasNext();) {
      Property prop = (Property) iter.next();
      results.add(parseQuota(prop));
    }
View Full Code Here

TOP

Related Classes of org.olat.properties.PropertyManager

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.