Package org.olat.properties

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


      if(p != null){
          p.setStringValue(charset);
          pm.updateProperty(p);
    } else {
          Property newP = pm.createUserPropertyInstance(identity, null, CHARSET, null, null, charset, null);
          pm.saveProperty(newP);
      }
  }

  /**
   * @see org.olat.user.UserManager#getUserCharset(org.olat.core.id.Identity)
View Full Code Here


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

  /**
   * @see org.olat.core.configuration.OLATModule#destroy()
View Full Code Here

    String propertyKey3 = "testNonTransactional-3";
    String testValue3 = "testNonTransactional-3";
    try {
      PropertyManager pm = PropertyManager.getInstance();
      Property p1 = pm.createPropertyInstance(null, null, null, null, propertyKey1, null, null, testValue1, null);
      pm.saveProperty(p1);
      Property p2 = pm.createPropertyInstance(null, null, null, null, propertyKey2, null, null, testValue2, null);
      pm.saveProperty(p2);
      // name is null => generated DB error => rollback ?
      Property p3 = pm.createPropertyInstance(null, null, null, null, null, null, null, testValue3, null);
      pm.saveProperty(p3);
View Full Code Here

    try {
      PropertyManager pm = PropertyManager.getInstance();
      Property p1 = pm.createPropertyInstance(null, null, null, null, propertyKey1, null, null, testValue1, null);
      pm.saveProperty(p1);
      Property p2 = pm.createPropertyInstance(null, null, null, null, propertyKey2, null, null, testValue2, null);
      pm.saveProperty(p2);
      // name is null => generated DB error => rollback ?
      Property p3 = pm.createPropertyInstance(null, null, null, null, null, null, null, testValue3, null);
      pm.saveProperty(p3);
      fail("Should generate error for rollback.");
      db.closeSession();
View Full Code Here

      pm.saveProperty(p1);
      Property p2 = pm.createPropertyInstance(null, null, null, null, propertyKey2, null, null, testValue2, null);
      pm.saveProperty(p2);
      // name is null => generated DB error => rollback ?
      Property p3 = pm.createPropertyInstance(null, null, null, null, null, null, null, testValue3, null);
      pm.saveProperty(p3);
      fail("Should generate error for rollback.");
      db.closeSession();
    } catch (Exception ex) {
      db.closeSession();
    }
View Full Code Here

        String propertyKey = "testDbPerfKey-" + loopCounter;
        DB db = DBFactory.getInstance();
        PropertyManager pm = PropertyManager.getInstance();
        String testValue = "testDbPerfValue-" + loopCounter;
        Property p = pm.createPropertyInstance(null, null, null, null, propertyKey, null, null, testValue, null);
        pm.saveProperty(p);
        // forget session cache etc.
        db.closeSession();
        pm.deleteProperty(p);
      }
      long endTime = System.currentTimeMillis();
View Full Code Here

        String propertyKey = "testDbPerfKey-" + loopCounter;
        DB db = DBFactory.getInstance();
        PropertyManager pm = PropertyManager.getInstance();
        String testValue = "testDbPerfValue-" + loopCounter;
        Property p = pm.createPropertyInstance(null, null, null, null, propertyKey, null, null, testValue, null);
        pm.saveProperty(p);
        // forget session cache etc.
        db.closeSession();
        db = DBFactory.getInstance();
        pm.deleteProperty(p);
      }
View Full Code Here

   
    DB db = DBFactory.getInstance();
    PropertyManager pm = PropertyManager.getInstance();
    String unicodetest = "a-greek a\u03E2a\u03EAa\u03E8 arab \u0630a\u0631 chinese:\u3150a\u3151a\u3152a\u3153a\u3173a\u3110-z";
    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();
View Full Code Here

        String propertyKey = "DbWorkerKey-" + workerId + "-" + loopCounter;
        DB db = DBFactory.getInstance();
        PropertyManager pm = PropertyManager.getInstance();
        String testValue = "DbWorkerValue-" + workerId + "-" + loopCounter;
        Property p = pm.createPropertyInstance(null, null, null, null, propertyKey, null, null, testValue, null);
        pm.saveProperty(p);
        // forget session cache etc.
        db.closeSession();
       
        db = DBFactory.getInstance();
        Property p2 = pm.findProperty(null, null, null, null, propertyKey);
View Full Code Here

    }
    RepositoryEntry re = CourseFactory.deployCourseFromZIP(exportedCourseZIPFile, access)
    if (re != null) {
      PropertyManager pm = PropertyManager.getInstance();
      Property prop = pm.createPropertyInstance(null, null, null, "_o3_", "deployedCourses", null, re.getKey(), absOrRelPath, null);
      pm.saveProperty(prop);
    }
    return re;
  }

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