Package org.olat.resource

Examples of org.olat.resource.OLATResourceManager


   * @return the new created resource
   */
  public FileResource createWiki() {
    FileResource resource = new WikiResource();
    createFolders(resource);
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.createOLATResourceInstance(resource);
    rm.saveOLATResource(ores);
    return resource;
  }
View Full Code Here


    // notify all current users of this resource (course) that it will be deleted now.
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new OLATResourceableJustBeforeDeletedEvent(res), res);
    //archiving is done within readyToDelete   
    CourseFactory.deleteCourse(res);
    // delete resourceable
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.findResourceable(res);
    rm.deleteOLATResource(ores);
    return true;
  }
View Full Code Here

 
  public SharedFolderFileResource createSharedFolder() {
    SharedFolderFileResource resource = new SharedFolderFileResource();
    VFSContainer rootContainer = FileResourceManager.getInstance().getFileResourceRootImpl(resource);
    if (rootContainer.createChildContainer(FOLDER_NAME) == null) return null;
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.createOLATResourceInstance(resource);
    rm.saveOLATResource(ores);
    return resource;
  }
View Full Code Here

  public GlossaryResource createGlossary() {
    GlossaryResource resource = new GlossaryResource();
    VFSContainer rootContainer = FileResourceManager.getInstance().getFileResourceRootImpl(resource);
    if (rootContainer == null) return null;
    if (rootContainer.createChildContainer(INTERNAL_FOLDER_NAME) == null) return null;
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.createOLATResourceInstance(resource);
    rm.saveOLATResource(ores);
    return resource;
  }
View Full Code Here

  /**
   * @param feedResource
   * @return The feed resourcable after creation on file system
   */
  private OLATResourceable createFeedResource(FeedFileResource feedResource) {
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.createOLATResourceInstance(feedResource);
    rm.saveOLATResource(ores);
    Feed feed = new Feed(feedResource);
    VFSContainer podcastContainer = getFeedContainer(feedResource);
    VFSLeaf leaf = podcastContainer.createChildLeaf(FEED_FILE_NAME);
    podcastContainer.createChildContainer(MEDIA_DIR);
    podcastContainer.createChildContainer(ITEMS_DIR);
View Full Code Here

      id1 = JunitTestHelper.createAndPersistIdentityAsUser("one");
      id2 = JunitTestHelper.createAndPersistIdentityAsUser("twoo");
      id3 = JunitTestHelper.createAndPersistIdentityAsUser("three");
     
      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) {
View Full Code Here

  /**
   * Initialize the
   *
   */
  public void init() {
    OLATResourceManager rm = OLATResourceManager.getInstance();
    quotaResource = rm.findOrPersistResourceable(OresHelper.lookupType(Quota.class));
    initDefaultQuotas(); // initialize default quotas
    Tracing.logInfo("Successfully initialized Quota Manager", QuotaManagerImpl.class);
  }
View Full Code Here

      tempFr.overrideResourceableId(resourceableId);
    }

    // add olat resource
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.findOrPersistResourceable(tempFr);

    // make IMS-Content-Packaging offline readable adding a html-frameset
    if (tempFr instanceof ImsCPFileResource) {
      CPOfflineReadableManager cporm = CPOfflineReadableManager.getInstance();
      cporm.makeCPOfflineReadable(ores, newName);
View Full Code Here

  public void deleteFileResource(OLATResourceable res) {
    // delete resources
    File fResourceFileroot = getFileResourceRoot(res);
    FileUtils.deleteDirsAndFiles(fResourceFileroot, true, true);
    // delete resourceable
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.findResourceable(res);
    if (ores != null) rm.deleteOLATResource(ores);
  }
View Full Code Here

   * Test creation of a repository entry.
   */
  public void testRawRepositoryEntryCreate() {
    try {
      DB db = DBFactory.getInstance();
      OLATResourceManager rm = OLATResourceManager.getInstance();
      // create course and persist as OLATResourceImpl
      OLATResourceable resourceable = new OLATResourceable() {
          public String getResourceableTypeName() {  return "Course";}
          public Long getResourceableId() {return new Long(456);}
      };
      OLATResource r =  rm.createOLATResourceInstance(resourceable);
      db.saveObject(r);
 
      // now make a repository entry for this course
      RepositoryEntry d = new RepositoryEntry();
      d.setOlatResource(r);
View Full Code Here

TOP

Related Classes of org.olat.resource.OLATResourceManager

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.