Examples of findProperty()


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

* setting mechanism, see method below
* @param tokenPropertyName
*/
  private void initializeSystemTokenProperty(String tokenPropertyName) {
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, SYSTEM_PROPERTY_CATEGORY, tokenPropertyName);
    if (p == null) {
      String token = RandomStringUtils.randomAlphanumeric(8);
      p = pm.createPropertyInstance(null, null, null, SYSTEM_PROPERTY_CATEGORY, tokenPropertyName, null, null, token, null);
      pm.saveProperty(p);
    }
View Full Code Here

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

      Tracing.logAudit("Trying to set maintenance message without using a token. Remote address::" + request.getRemoteAddr(), AdminModule.class);
      return false;
    }
    // get token and compate
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, AdminModule.SYSTEM_PROPERTY_CATEGORY, tokenPropertyName);
    String token = (p == null ? "" : p.getStringValue());
    if (token.matches(submittedToken)) { // limit access to token
      return true;
    } else {
      Tracing.logAudit("Trying to set maintenance message using a wrong token. Remote address::" + request.getRemoteAddr(), AdminModule.class);
View Full Code Here

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

    }
    // 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);
  }

  public void testRollbackNonTransactional() {
    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 NOT 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()

    }
    // check if p1 & p2 is NOT 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()

    Property p = pm.createPropertyInstance(null, null, null, null, "superbluberkey", null, null, unicodetest, null);
    pm.saveProperty(p);
    // forget session cache etc.
    db.closeSession();
   
    Property p2 = pm.findProperty(null, null, null, null, "superbluberkey");
    String lStr = p2.getStringValue();
    assertEquals(unicodetest, lStr);
   
  }
View Full Code Here

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

        pm.saveProperty(p);
        // forget session cache etc.
        db.closeSession();
       
        db = DBFactory.getInstance();
        Property p2 = pm.findProperty(null, null, null, null, propertyKey);
        String lStr = p2.getStringValue();
        if (!testValue.equals(lStr)) {
          Tracing.logInfo("Property ERROR testValue=" + testValue + ": lStr=" + lStr, this.getClass());
          errorCounter++;
        }
View Full Code Here

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

  }

  private String listAllProperties() {
    StringBuilder buf = new StringBuilder();
    PropertyManager pm = PropertyManager.getInstance();
    Property p1 = pm.findProperty(null, null, null, propertyCategory, propertyKey1);
    if (p1 == null) {
      buf.append(propertyKey1 + "=null");
    } else {
      buf.append(propertyKey1 + "=" + p1.getStringValue());
    }
View Full Code Here

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

      buf.append(propertyKey1 + "=null");
    } else {
      buf.append(propertyKey1 + "=" + p1.getStringValue());
    }
    buf.append("<br />");
    Property p2 = pm.findProperty(null, null, null, propertyCategory, propertyKey2);
    if (p2 == null) {
      buf.append(propertyKey2 + "=null");
    } else {
      buf.append(propertyKey2 + "=" + p2.getStringValue() );
    }
View Full Code Here

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

                // let's quit quickly ;)
                return;
              }
              // load comic start date only once
              PropertyManager pm = PropertyManager.getInstance();
              Property p = pm.findProperty(null, null, null, PROPERTY_CATEGORY, PROPERTY_NAME);
              if (p == null) {
                // wow first time ever, save current date
                p = pm.createPropertyInstance(null, null, null, PROPERTY_CATEGORY, PROPERTY_NAME, null, null, null, null);
                pm.saveProperty(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.