Examples of OLATResourceManager


Examples of org.olat.resource.OLATResourceManager

 
  /**
   */
  public void testQueryReferencableResourcesLimitType() {
    DB db = DBFactory.getInstance();
    OLATResourceManager resm = OLATResourceManager.getInstance();
    RepositoryManager rm = RepositoryManager.getInstance();
    Manager securityManager = ManagerFactory.getManager();
   
    Identity id1 = JunitTestHelper.createAndPersistIdentityAsAuthor("id1");
    Identity id2 = JunitTestHelper.createAndPersistIdentityAsAuthor("id2");

    // generate 5000 repo entries
    int numbRes = 5000;
    long startCreate = System.currentTimeMillis();
    for (int i = 1; i < numbRes; i++) {
      // create course and persist as OLATResourceImpl
      final int ifin = i;
      OLATResourceable resourceable = new OLATResourceable() {
        public String getResourceableTypeName() {  return CourseModule.getCourseTypeName();}
        public Long getResourceableId() {return new Long(ifin);}
      };
      OLATResource r =  resm.createOLATResourceInstance(resourceable);
      db.saveObject(r);
     
      // now make a repository entry for this course
      RepositoryEntry re = rm.createRepositoryEntryInstance("Florian Gnägi", "Lernen mit OLAT " + i, "yo man description bla bla + i");
      re.setDisplayname("JunitTest_RepositoryEntry_" + i);
View Full Code Here

Examples of org.olat.resource.OLATResourceManager

    codepointClient.close();
    System.out.println("testConcurrentIncrementLaunchCounterWithCodePoints finish successful");   
  }

  private RepositoryEntry createRepository(String name, final Long resourceableId) {
    OLATResourceManager rm = OLATResourceManager.getInstance();
    // create course and persist as OLATResourceImpl
    OLATResourceable resourceable = new OLATResourceable() {
        public String getResourceableTypeName() {  return CourseModule.ORES_TYPE_COURSE;}
        public Long getResourceableId() {return resourceableId;}
    };
    OLATResource r =  rm.createOLATResourceInstance(resourceable);
    DBFactory.getInstance().saveObject(r);

    // now make a repository entry for this course
    RepositoryEntry d = new RepositoryEntry();
    d.setOlatResource(r);
View Full Code Here

Examples of org.olat.resource.OLATResourceManager

      id2 = JunitTestHelper.createAndPersistIdentityAsUser("twoo");
      id3 = JunitTestHelper.createAndPersistIdentityAsUser("three");
      id4 = JunitTestHelper.createAndPersistIdentityAsUser("four");

      DB db = DBFactory.getInstance();
      OLATResourceManager rm = OLATResourceManager.getInstance();
      // create course and persist as OLATResourceImpl
      OLATResourceable resourceable = OresHelper.createOLATResourceableInstance("junitcourse", new Long(456));
      course1 = rm.createOLATResourceInstance(resourceable);
      db.saveObject(course1);

      DBFactory.getInstance().closeSession();
    } catch (Exception e) {
      log.error("Exception in setUp(): " + e);
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.