Package org.olat.repository

Examples of org.olat.repository.RepositoryEntry


    // grab any shared folder that is configured
    OlatRootFolderImpl sharedFolder = null;
    String sfSoftkey = getCourseConfig().getSharedFolderSoftkey();
    if (sfSoftkey != null) {
      RepositoryManager rm = RepositoryManager.getInstance();
      RepositoryEntry re = rm.lookupRepositoryEntryBySoftkey(sfSoftkey, false);
      if (re != null) {
        sharedFolder = SharedFolderManager.getInstance().getSharedFolder(re.getOlatResource());
        if (sharedFolder != null){
          sharedFolder.setLocalSecurityCallback(new ReadOnlyCallback());
          //add local course folder's children as read/write source and any sharedfolder as subfolder
          courseFolderContainer.addContainer(new NamedContainerImpl("_sharedfolder", sharedFolder));
        }
View Full Code Here


   */
  public String getCourseTitle() {
    synchronized (courseTitleSyncObj) { //o_clusterOK by:ld/se
      if (courseTitle == null) {
        // load repository entry for this course and get title from it
        RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(
            OresHelper.createOLATResourceableInstance(CourseModule.class, this.resourceableId), false);
        if (re == null) throw new AssertException(
            "trying to get repoentry of a course to get the title, but no repoentry found although course is there, course resid = "
                + resourceableId);
        courseTitle = re.getDisplayname();       
      }
    }
    return courseTitle;
  }
View Full Code Here

    PersistingCourseGroupManager.getInstance(this).exportCourseLeaningGroups(fExportedDataDir);
    // export right groups
    PersistingCourseGroupManager.getInstance(this).exportCourseRightGroups(fExportedDataDir);
    // export repo metadata
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry myRE = rm.lookupRepositoryEntry(this, true);
    RepositoryEntryImportExport importExport = new RepositoryEntryImportExport(myRE, fExportedDataDir);
    importExport.exportDoExportProperties();
   
    //OLAT-5368: do intermediate commit to avoid transaction timeout
    // discussion intermediatecommit vs increased transaction timeout:
View Full Code Here

    if (!exportedCourseZIPFile.exists()) {
      //do not throw exception as users may upload bad file
      System.out.println("Cannot deploy course from file: " + exportedCourseZIPFile.getAbsolutePath());
      return null;
    }
    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

    MergeSource cfRoot = new MergeSource(null, null);
    RepositoryManager rm = RepositoryManager.getInstance();
    List courseEntries = rm.queryByOwner(identity, CourseModule.getCourseTypeName());
   
    for (Iterator iter = courseEntries.iterator(); iter.hasNext();) {
      RepositoryEntry re = (RepositoryEntry) iter.next();
      OLATResourceable res = re.getOlatResource();
      ICourse course = CourseFactory.loadCourse(res.getResourceableId());
      VFSContainer courseFolder = course.getCourseFolderContainer();
      //NamedContainerImpl cfContainer = new NamedContainerImpl(Formatter.makeStringFilesystemSave(course.getCourseTitle()), courseFolder);
      NamedContainerImpl cfContainer;
      cfContainer = new NamedContainerImpl(Formatter.makeStringFilesystemSave(course.getCourseTitle()), courseFolder);
View Full Code Here

        Long newParentId = Long.parseLong(nodeId);
        CatalogEntry newParent = cm.loadCatalogEntry(newParentId);
        // check first if this repo entry is already attached to this new parent
        List<CatalogEntry> existingChildren = cm.getChildrenOf(newParent);
        for (CatalogEntry existingChild : existingChildren) {
          RepositoryEntry existingRepoEntry = existingChild.getRepositoryEntry();
          if (existingRepoEntry != null && existingRepoEntry.equalsByPersistableKey(toBeAddedEntry)) {
            showError("catalog.tree.add.already.exists", toBeAddedEntry.getDisplayname());
            return;
          }
        }
        // don't create entry right away, user must select submit button first
View Full Code Here

      // start glossary in window
      final CourseConfig cc = courseEnvir.getCourseConfig(); // do not cache cc, not save
     
      // if glossary had been opened from LR as Tab before, warn user:
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(cc.getGlossarySoftKey(), false);
      DTab dt = dts.getDTab(repoEntry.getOlatResource());
      if (dt != null) {
        dts.activate(ureq, dt, ((Boolean)allowGlossaryEditing).toString());
      } else {
        ControllerCreator ctrlCreator = new ControllerCreator() {
          public Controller createController(UserRequest lureq, WindowControl lwControl) {
View Full Code Here

    ZipUtil.zip(sharedFolder.getItems(), new LocalFileImpl(fExportZIP));
    return new CleanupAfterDeliveryFileMediaResource(fExportZIP);
  }

  public boolean exportSharedFolder(String sharedFolderSoftkey, File exportedDataDir) {
    RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(
     sharedFolderSoftkey, false);
    if (re == null) return false;
    File fExportBaseDirectory = new File(exportedDataDir, "sharedfolder");
    if (!fExportBaseDirectory.mkdir()) return false;
View Full Code Here

   * @param courseConfig use the glossary configuration from the given course
   *          configuration
   */
  public static GlossaryMarkupItemController createGlossaryMarkupWrapper(UserRequest ureq, WindowControl wControl, Component tmComponent, CourseConfig courseConfig){
    if (courseConfig.hasGlossary()) {
      RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(courseConfig.getGlossarySoftKey()false);
      if (repoEntry == null) {
        // seems to be removed
        return null;
      }
      VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(repoEntry.getOlatResource());
      String glossaryId = repoEntry.getOlatResource().getResourceableId().toString();
      return new GlossaryMarkupItemController(ureq, wControl, tmComponent, glossaryFolder, glossaryId);
    }
    return null;
  }
View Full Code Here

   * @return
   */
  public static GlossaryMainController createCourseGlossaryMainRunController(WindowControl lwControl, UserRequest lureq, CourseConfig cc,
      boolean allowGlossaryEditing) {
    if (cc.hasGlossary()) {
      RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(cc.getGlossarySoftKey(),
          false);
      if (repoEntry == null) {
        // seems to be removed
        return null;
      }
      VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(repoEntry.getOlatResource());
      return new GlossaryMainController(lwControl, lureq, glossaryFolder, repoEntry.getOlatResource(), allowGlossaryEditing);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.olat.repository.RepositoryEntry

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.