Package org.olat.repository

Examples of org.olat.repository.RepositoryEntry


  /**
   * @see org.olat.repository.handlers.RepositoryHandler#supportsDownload()
   */
  public void doIndex(SearchResourceContext resourceContext, Object parentObject, OlatFullIndexer indexWriter) throws IOException,
      InterruptedException {
    RepositoryEntry repositoryEntry = (RepositoryEntry) parentObject;
    Tracing.logDebug("Analyse Glosary RepositoryEntry...", GlossaryRepositoryIndexer.class);
    try {
      resourceContext.setDocumentType(TYPE);
      Document document = GlossaryManager.getInstance().getIndexerDocument(repositoryEntry, resourceContext);
      if (document != null) {
View Full Code Here


      } else {
        // only list the specified folders
        for (String folder : publiclyReadableFolders) {
          try {
            Long repoKey = Long.parseLong(folder);
            RepositoryEntry entry = repoManager.lookupRepositoryEntry(repoKey);
            if (entry != null) {
              if (entry.getAccess() >= RepositoryEntry.ACC_USERS) {
                // add folder (which is a repo entry) to root container if not
                // present
                addReadonlyFolder(rootContainer, entry, sfm, addedEntries);
              } else {
                logWarn("Access denied on entry::" + entry.getKey(), null);
              }
            } else {
              logWarn("The repsitoryEntryId::" + folder + " does not exist.", null);
            }
          } catch (NumberFormatException e) {
View Full Code Here

    }
    File courseExportData = ImportCourseController.getExportDataDir(course);
    // get the export data directory
    // create the repository entry
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry re = rm.createRepositoryEntryInstance("administrator");
    RepositoryEntryImportExport importExport = new RepositoryEntryImportExport(courseExportData);
    String softKey = importExport.getSoftkey();
    RepositoryEntry existingEntry = rm.lookupRepositoryEntryBySoftkey(softKey, false);
    if (existingEntry != null) {
      Tracing.logInfo("RepositoryEntry with softkey " + softKey + " already exists. Course will not be deployed.", CourseFactory.class);
      CourseFactory.deleteCourse(newCourseResource);
      return existingEntry;
    }
View Full Code Here

   */
  public static Controller createHelpCourseLaunchController(UserRequest ureq, WindowControl wControl) {
    // Find repository entry for this course
    String helpCourseSoftKey = CourseModule.getHelpCourseSoftKey();
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry entry = null;
    if (helpCourseSoftKey != null) {
      entry = rm.lookupRepositoryEntryBySoftkey(helpCourseSoftKey, false);
    }
    if (entry == null) {
      wControl.setError("error.helpcourse.not.configured");
      // create empty main controller
      LayoutMain3ColsController emptyCtr = new LayoutMain3ColsController(ureq, wControl, null, null, null, null);
      return emptyCtr;
    } else {
      // Increment launch counter
      rm.incrementLaunchCounter(entry);
      OLATResource ores = entry.getOlatResource();
      ICourse course = loadCourse(ores);
     
      ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(entry);
      WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl)
     
View Full Code Here

    //close courseEditSession if not already closed
    closeCourseEditSession(resourceableId, false);
  }

  public static Controller createDisposedCourseRestartController(UserRequest ureq, WindowControl wControl, long resId) {
    RepositoryEntry courseRepositoryEntry = RepositoryManager.getInstance().lookupRepositoryEntry(resId);
    return new DisposedCourseRestartController(ureq, wControl, courseRepositoryEntry);
  }
View Full Code Here

    this.courseResourceableId = courseResourceableId;
   
    myContent = createVelocityContainer("CourseGlossary");
   
    if (courseConfig.hasGlossary()) {
      RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(courseConfig.getGlossarySoftKey(), false);
      if (repoEntry == null) {
        // Something is wrong here, maybe the glossary has been deleted. Try to
        // remove glossary from configuration
        doRemoveGlossary(ureq);
        log.warn("Course with ID::" + courseResourceableId + " had a config for a glossary softkey::"
View Full Code Here

   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == repoSearchCtr) {
      cmc.deactivate();
      if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
        RepositoryEntry repoEntry = repoSearchCtr.getSelectedEntry();
        doSelectGlossary(repoEntry, ureq);
        fireEvent(ureq, Event.CHANGED_EVENT);// FIXME:pb:send event to agency
      }
    }
  }
View Full Code Here

        Long newParentId = Long.parseLong(node.getIdent());
        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;
          }
        }
        CatalogEntry newEntry = cm.createCatalogEntry();
View Full Code Here

    if (!courseConfig.hasCustomSharedFolder()) {
      name = translator.translate("sf.notconfigured");
      hasSF = false;
      myContent.contextPut("hasSharedFolder", new Boolean(hasSF));
    } else {
      RepositoryEntry re = rm.lookupRepositoryEntryBySoftkey(softkey, false);
      if (re == null) {
        //log.warning("Removed configured sahred folder from course config, because repo entry does not exist anymore.");
        courseConfig.setSharedFolderSoftkey(CourseConfig.VALUE_EMPTY_SHAREDFOLDER_SOFTKEY);
        name = translator.translate("sf.notconfigured");
        hasSF = false;
        myContent.contextPut("hasSharedFolder", new Boolean(hasSF));
      } else {
        name = re.getDisplayname();
        hasSF = true;
        myContent.contextPut("hasSharedFolder", new Boolean(hasSF));
      }
    }
    myContent.contextPut("resourceTitle", name);
View Full Code Here

    } else if (source == unselectSFResButton) { // unselect shared folder     
      if (courseConfig.hasCustomSharedFolder()) {
        // delete reference from course to sharedfolder
        // get unselected shared folder's softkey used for logging
        String softkeyUsf = courseConfig.getSharedFolderSoftkey();
        RepositoryEntry usfRe = rm.lookupRepositoryEntryBySoftkey(softkeyUsf, true);
        if (usfRe != null) sharedFolderRepositoryEntry = usfRe;
        // set default value to delete configured value in course config
        courseConfig.setSharedFolderSoftkey(CourseConfig.VALUE_EMPTY_SHAREDFOLDER_SOFTKEY);
        //deleteRefTo(course);
        //course.getCourseEnvironment().setCourseConfig(cc);
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.