Package org.olat.repository

Examples of org.olat.repository.RepositoryEntry


   * </ul>
   *
   * @param feed
   */
  private void enrichFeedByRepositoryEntryInfromation(Feed feed) {
    RepositoryEntry entry = getRepositoryEntry(feed);
    if (entry != null && feed != null) {
      Date whenTheFeedWasLastModified = feed.getLastModified();
      if (whenTheFeedWasLastModified == null || entry.getLastModified().after(whenTheFeedWasLastModified)) {
        // entry is newer then feed, update feed
        feed.setTitle(entry.getDisplayname());
        // Formatter.formatWikiMarkup(entry.getDescription())
        feed.setDescription(entry.getDescription());
        feed.setAuthor(entry.getInitialAuthor());
        // Update the image
        String imageFilename = RepositoryEntryImageController.getImageFilename(entry);
        String repoImagePath = FolderConfig.getCanonicalRoot() + FolderConfig.getRepositoryHome() + "/" + imageFilename;
        File repoEntryImage = new File(repoImagePath);
        if (repoEntryImage.exists()) {
View Full Code Here


   * </ul>
   *
   * @param feed
   */
  void enrichRepositoryEntryByFeedInformation(Feed feed) {
    RepositoryEntry entry = getRepositoryEntry(feed);
    if (entry != null && feed != null) {
      Date whenTheFeedWasLastModified = feed.getLastModified();
      if (whenTheFeedWasLastModified != null && entry.getLastModified().before(whenTheFeedWasLastModified)) {
        // feed is newer than repository entry, update repository entry
        entry.setDisplayname(feed.getTitle());
        entry.setDescription(feed.getDescription());
        // Update the image
        VFSContainer repoHome = new LocalFolderImpl(new File(FolderConfig.getCanonicalRoot() + FolderConfig.getRepositoryHome()));
        String imageFilename = RepositoryEntryImageController.getImageFilename(entry);
        VFSItem oldEntryImage = repoHome.resolve(imageFilename);
        if (oldEntryImage != null) {
View Full Code Here

   * @see org.olat.search.service.indexer.Indexer#doIndex(org.olat.search.service.SearchResourceContext,
   *      java.lang.Object, org.olat.search.service.indexer.OlatFullIndexer)
   */
  public void doIndex(SearchResourceContext searchResourceContext, ICourse course, CourseNode node, OlatFullIndexer indexer)
      throws IOException, InterruptedException {
    RepositoryEntry repositoryEntry = node.getReferencedRepositoryEntry();
    // used for log messages
    String repoEntryName = "*name not available*";
    try {
      repoEntryName = repositoryEntry.getDisplayname();
      if (log.isDebug()) {
        log.info("Indexing: " + repoEntryName);
      }
      Feed feed = FeedManager.getInstance().readFeed(repositoryEntry.getOlatResource());

      // Set the document type, e.g. type.repository.entry.FileResource.BLOG
      SearchResourceContext nodeSearchContext = new SearchResourceContext(searchResourceContext);
      nodeSearchContext.setBusinessControlFor(node);
      nodeSearchContext.setDocumentType(getDocumentType());
View Full Code Here

   * @see org.olat.search.service.indexer.Indexer#doIndex(org.olat.search.service.SearchResourceContext,
   *      java.lang.Object, org.olat.search.service.indexer.OlatFullIndexer)
   */
  public void doIndex(SearchResourceContext searchResourceContext, Object parentObject, OlatFullIndexer indexer) throws IOException,
      InterruptedException {
    RepositoryEntry repositoryEntry = (RepositoryEntry) parentObject;
    // used for log messages
    String repoEntryName = "*name not available*";
    try {
      repoEntryName = repositoryEntry.getDisplayname();
      if (log.isDebug()) {
        log.info("Indexing: " + repoEntryName);
      }
      Feed feed = FeedManager.getInstance().readFeed(repositoryEntry.getOlatResource());

      // Set the document type, e.g. type.repository.entry.FileResource.BLOG
      searchResourceContext.setDocumentType(getDocumentType());
      searchResourceContext.setParentContextType(getDocumentType());
      searchResourceContext.setParentContextName(repoEntryName);
View Full Code Here

  /**
   * @see org.olat.repository.handlers.RepositoryHandler#supportsDownload()
   */

  public void doIndex(SearchResourceContext parentResourceContext, Object parentObject, OlatFullIndexer indexWriter) {
    RepositoryEntry repositoryEntry = (RepositoryEntry) parentObject;
    if (log.isDebug()) log.debug("Analyse Course... repositoryEntry=" + repositoryEntry);
    try {
      RepositoryEntryStatus status = RepositoryManager.getInstance().createRepositoryEntryStatus(repositoryEntry.getStatusCode());
      if(status.isClosed()) {
        if(log.isDebug()) log.debug("Course not indexed because it's closed: repositoryEntry=" + repositoryEntry);
        return;
      }

      ICourse course = CourseFactory.loadCourse(repositoryEntry.getOlatResource());
      // course.getCourseTitle(); // do not index title => index root-node
      parentResourceContext.setParentContextType(TYPE);
      parentResourceContext.setParentContextName(course.getCourseTitle());
      doIndexCourse( parentResourceContext, course,  course.getRunStructure().getRootNode(), indexWriter);     
    } catch (Exception ex) {
View Full Code Here

      // not a course node of course we have access to the course metadata
      return true;
    }
    if (log.isDebug()) log.debug("Start identity=" + identity + "  roles=" + roles);
    Long repositoryKey = contextEntry.getOLATResourceable().getResourceableId();
    RepositoryEntry repositoryEntry = repositoryManager.lookupRepositoryEntry(repositoryKey);
    if (log.isDebug()) log.debug("repositoryEntry=" + repositoryEntry );

    Long nodeId = bcContextEntry.getOLATResourceable().getResourceableId();
    if (log.isDebug()) log.debug("nodeId=" + nodeId );
   
    ICourse course = CourseFactory.loadCourse(repositoryEntry.getOlatResource());
    IdentityEnvironment ienv = new IdentityEnvironment();
    ienv.setIdentity(identity);
    ienv.setRoles(roles);
    UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
    if (log.isDebug()) log.debug("userCourseEnv=" + userCourseEnv + "ienv=" + ienv );
View Full Code Here

  /**
   * @see org.olat.repository.handlers.RepositoryHandler#supportsDownload()
   */

  public void doIndex(SearchResourceContext resourceContext, Object parentObject, OlatFullIndexer indexWriter) throws IOException,InterruptedException  {
    RepositoryEntry repositoryEntry = (RepositoryEntry) parentObject;
    if (log.isDebug()) log.debug("Analyse IMS CP RepositoryEntry...");

    resourceContext.setDocumentType(TYPE);
   
    if (repositoryEntry == null) throw new AssertException("no Repository");
    File cpRoot = FileResourceManager.getInstance().unzipFileResource(repositoryEntry.getOlatResource());
    if (cpRoot == null) throw new AssertException("file of repository entry " + repositoryEntry.getKey() + "was missing");

    resourceContext.setParentContextType(TYPE);
    resourceContext.setParentContextName(repositoryEntry.getDisplayname());
    VFSContainer rootContainer = new LocalFolderImpl(cpRoot);
    doIndexVFSContainer(resourceContext,rootContainer,indexWriter,"", FolderIndexerAccess.FULL_ACCESS);

  }
View Full Code Here

    //pull as admin
    Roles roles = new Roles(true, true, true, true, false, true);
    List<RepositoryEntry> allCourses = rm.queryByTypeLimitAccess(CourseModule.getCourseTypeName(), roles);
    int counter = 0;
    for (Iterator<RepositoryEntry> iterator = allCourses.iterator(); iterator.hasNext();) {
      RepositoryEntry entry = iterator.next();
      ICourse course = null;
      try{
        course = CourseFactory.loadCourse(entry.getOlatResource());
      } catch (Exception e) {
        log.error("Could not load Course! OlatResourcable: "+entry.getOlatResource(), e);
        continue;
      }
     
      CourseGroupManager groupManager = course.getCourseEnvironment().getCourseGroupManager();
      List<BusinessGroup> groups = groupManager.getAllLearningGroupsFromAllContexts();
View Full Code Here

  /**
   * @see org.olat.repository.handlers.RepositoryHandler#supportsDownload()
   */

  public void doIndex(SearchResourceContext resourceContext, Object parentObject, OlatFullIndexer indexWriter) throws IOException,InterruptedException  {
    RepositoryEntry repositoryEntry = (RepositoryEntry) parentObject;
    if (log.isDebug()) log.debug("Analyse Shared Folder RepositoryEntry...");

    resourceContext.setDocumentType(TYPE);
    resourceContext.setParentContextType(TYPE);
    resourceContext.setParentContextName(repositoryEntry.getDisplayname());
   
    VFSContainer sfContainer = SharedFolderManager.getInstance().getSharedFolder(repositoryEntry.getOlatResource());
    doIndexVFSContainer(resourceContext,sfContainer,indexWriter,"", FolderIndexerAccess.FULL_ACCESS);

  }
View Full Code Here

   
    //two cases:
    // -- VERY RARE CASE -- 1) qti is open in an editor session right now on the screen (or session on the way to timeout)
    // -- 99% of cases   -- 2) qti is ready to be run as test/survey
    String repositorySoftkey = (String) moduleConfiguration.get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
    RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftkey, true);
    if (CoordinatorManager.getCoordinator().getLocker().isLocked(re.getOlatResource(), null)){
      Translator translator = Util.createPackageTranslator(this.getClass(), ureq.getLocale());
      //so this resource is locked, let's find out who locked it
      LockResult lockResult = CoordinatorManager.getCoordinator().getLocker().acquireLock(re.getOlatResource(), ureq.getIdentity(), null);
      return MessageUIFactory.createInfoMessage(ureq, wControl, translator.translate("status.currently.locked.title"),
          translator.translate("status.currently.locked", new String[] {lockResult.getOwner().getName()}));
    }else{
      ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(re, OlatResourceableType.iq));
      return new IQDisplayController(moduleConfiguration, secCallback, ureq, wControl, callingResId, callingResDetail);
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.