Package org.olat.repository

Examples of org.olat.repository.RepositoryEntry


        // remove selected entry from the data model
        CatalogManager cm = CatalogManager.getInstance();
        List<CatalogEntry> children = cm.getChildrenOf(selectedCategoryLevel);
        // find all child element of this level that reference our repo entry
        for (CatalogEntry child : children) {
          RepositoryEntry childRepoEntry = child.getRepositoryEntry();
          if (childRepoEntry != null && childRepoEntry.equalsByPersistableKey(repoEntry)) {
            // remove from catalog
            cm.deleteCatalogEntry(child);
          }
        }
        // The catalog entry must have been deleted in the meantime by someone
View Full Code Here


   * @param glossarySoftkey
   * @param exportedDataDir
   * @return
   */
  public boolean exportGlossary(String glossarySoftkey, File exportedDataDir) {
    RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(glossarySoftkey, false);
    if (re == null) return false;
    File fExportBaseDirectory = new File(exportedDataDir, EXPORT_FOLDER_NAME);
    if (!fExportBaseDirectory.mkdir()) return false;
    // export properties
    RepositoryEntryImportExport reImportExport = new RepositoryEntryImportExport(re, fExportBaseDirectory);
View Full Code Here

   *
   * @param res
   * @return
   */
  public MediaResource getAsMediaResource(OLATResourceable res) {
    RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntry(res, false);
    String exportFileName = repoEntry.getDisplayname() + ".zip";
    File fExportZIP = new File(FolderConfig.getCanonicalTmpDir() + "/" + exportFileName);
    VFSContainer glossaryRoot = getGlossaryRootFolder(res);
    ZipUtil.zip(glossaryRoot.getItems(), new LocalFileImpl(fExportZIP));
    return new CleanupAfterDeliveryFileMediaResource(fExportZIP);
  }
View Full Code Here

          String courseNodeId = courseNode.substring(0, courseNode.indexOf(':'));
          Long resId = publisher.getResId();
          ICourse course = CourseFactory.loadCourse(resId);
          RepositoryManager rm = RepositoryManager.getInstance();
          OLATResource rsrc = OLATResourceManager.getInstance().findResourceable(course.getResourceableId(), course.getResourceableTypeName());
          RepositoryEntry re = rm.lookupRepositoryEntry(rsrc, true);
          //node forum
          businessPath = "[RepositoryEntry:" + re.getKey() + "][CourseNode:" + courseNodeId + "]";
        } catch (Exception e) {
          businessPath = null;
          //if something went wrong, like error while loading course...
          logWarn("error while processing resid: "+publisher.getResId(), e);
         
View Full Code Here

      /*
       * for those coursenodes which need a reference to a repository entry to
       * function properly, check that the reference is valid
       */
      if (cn.needsReferenceToARepositoryEntry()) {
        RepositoryEntry referencedEntry = cn.getReferencedRepositoryEntry();
        if (referencedEntry == null) {
          cetnDamaged.add(new StatusDescription(ValidationStatus.ERROR, "pbl.error.refs", "pbl.error.refs", new String[] { cetn.getTitle()
              + "(id:" + cetn.getIdent() + " )" }, PACKAGE));
        }
      }
View Full Code Here

   *          null if updatedNode is a new node.
   */
  private void updateRefs(CourseNode updatedNode, CourseNode oldNode) {
    if (oldNode != null) deleteRefs(oldNode);
    if (updatedNode.needsReferenceToARepositoryEntry()) {
      RepositoryEntry referencedEntry = updatedNode.getReferencedRepositoryEntry();
      if (referencedEntry == null) throw new AssertException("Could not fetch referenced entry where an entry is expected.");
      // if there is an entry, add the reference
      addRef(updatedNode, referencedEntry.getOlatResource());
    }
  }
View Full Code Here

    myContent = new VelocityContainer("olatmodiqrun", VELOCITY_ROOT + "/qti.html", translator, this);
   
    // Check if fibautocompl.js and fibautocompl.css exists for enhance FIB autocomplete feature
     Resolver autcompResolver = null;
    if (resolver == null){
      RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftkey, true);
       autcompResolver = new ImsRepositoryResolver(re.getKey());
    } else {
      autcompResolver = this.resolver;
    }
     
    if (autcompResolver != null && autcompResolver.hasAutocompleteFiles()) {
View Full Code Here

  public String getJumpInLink() {
    String jumpInLink = null;
    RepositoryManager resMgr = RepositoryManager.getInstance();
    if (courseId != null && nodeId != null) {
      OLATResourceable oresCourse = OLATResourceManager.getInstance().findResourceable(courseId, CourseModule.getCourseTypeName());
      RepositoryEntry repositoryEntry = resMgr.lookupRepositoryEntry(oresCourse, false);
      jumpInLink = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(repositoryEntry, nodeId);
    } else {
      RepositoryEntry repositoryEntry = resMgr.lookupRepositoryEntry(feed, false);
      jumpInLink = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(repositoryEntry);
    }
    return jumpInLink;
  }
View Full Code Here

            NotificationsManager.getInstance().deactivate(p);
            // return nothing available
            return NotificationsManager.getInstance().getNoSubscriptionInfo();
          }
          ModuleConfiguration config = ((WikiCourseNode)courseNode).getModuleConfiguration();
          RepositoryEntry re = WikiEditController.getWikiRepoReference(config, true);
          resId = re.getOlatResource().getResourceableId();
          logDebug("resId=" + resId, null);
          ores = OresHelper.createOLATResourceableInstance(WikiResource.TYPE_NAME, resId);
          businessControlString = p.getBusinessPath() + "[path=";
        } else {
          // resName = 'BusinessGroup' or 'FileResource.WIKI'
View Full Code Here

        //NotificationsManager.getInstance().delete(publisher);
        // return nothing available
        return null;
      }
      ModuleConfiguration config = ((WikiCourseNode)courseNode).getModuleConfiguration();
      RepositoryEntry re = WikiEditController.getWikiRepoReference(config, true);
      resId = re.getOlatResource().getResourceableId();
      businessPath = "[RepositoryEntry:" + re.getKey().toString() + "]"
        + "[CourseNode:" + publisher.getSubidentifier() + "]";
    } else {
      // resName = 'BusinessGroup' or 'FileResource.WIKI'
      OLATResourceable ores = OresHelper.createOLATResourceableInstance(publisher.getResName(), resId);
      BusinessGroup bGroup = BusinessGroupManagerImpl.getInstance().loadBusinessGroup(resId, false);
      if (bGroup==null) {
        // Wiki as Repo-Ressource
        RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(ores,false);
        if (re != null) {
          businessPath = "[RepositoryEntry:" + re.getKey().toString() + "]"
          + "["+re.getOlatResource().getResourceableTypeName()+":" + re.getResourceableId() + "]";
        } else {
          //repo entry not found, delete publisher
          logInfo("deleting publisher with key; "+publisher.getKey(), null);
          //NotificationsManager.getInstance().delete(publisher);
          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.