Examples of findProperty()


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

      db.closeSession();
    }
    // check if p1 is rollbacked
    db = DBFactory.getInstance();
    PropertyManager pm = PropertyManager.getInstance();
    Property p =pm.findProperty(null, null, null, null, propertyKey);
    this.assertNull("Property.save is NOT rollbacked", p);
  }
   
  public void testMixedNonTransactional_Transactional() {
    DB db = DBFactory.getInstance();
View Full Code Here

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

    } catch (Exception ex) {
      db.closeSession();
    }
    // check if p1&p2 is rollbacked
    PropertyManager pm = PropertyManager.getInstance();
    Property p_1 =pm.findProperty(null, null, null, null, propertyKey1);
    this.assertNull("Property1 is NOT rollbacked", p_1);
    Property p_2 =pm.findProperty(null, null, null, null, propertyKey2);
    this.assertNull("Property2 is NOT rollbacked", p_2);
  }
View Full Code Here

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

    long aqTime;
    Identity lockOwner;
    boolean success;
    Property p;

    p = pm.findProperty(null, null, null, CATEGORY_PERSISTENTLOCK, derivedLockString);
    if (p == null) {
      // no persistent lock acquired yet
      // save a property: cat = o_lock, key = derivedLockString, Longvalue = key
      // of identity acquiring the lock
      Property newp = pm.createPropertyInstance(null, null, null, CATEGORY_PERSISTENTLOCK, derivedLockString, null, ident.getKey(), null,
View Full Code Here

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

   */
  public void releasePersistentLock(LockResult le) {
    //synchronisation is solved in the LockManager
    String derivedLockString = ((LockResultImpl)le).getLockEntry().getKey();
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, CATEGORY_PERSISTENTLOCK, derivedLockString);
    if (p == null) throw new AssertException("could not release lock: no lock in db, " + derivedLockString);
    Identity ident = le.getOwner();
    Long ownerKey = p.getLongValue();
    if (!ownerKey.equals(ident.getKey())) throw new AssertException("user " + ident.getName()
        + " cannot release lock belonging to user with key " + ownerKey + " on resourcestring " + derivedLockString);
View Full Code Here

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

    /*
     * ensure that the infomessage property exists on the system
     */
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, "_o3_", "InfoMsg");
    if (p == null) {
      p =  pm.createPropertyInstance(null,  null,  null,  "_o3_", "InfoMsg", null, null, null, InfoMessageManager.EMPTY_MESSAGE);
      pm.saveProperty(p);
    }
    /*
 
View Full Code Here

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

   
    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);
View Full Code Here

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

   
    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;
View Full Code Here

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

   * 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);
View Full Code Here

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

  }

  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

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

  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
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.