Search in sources :

Example 1 with RepositoryEntryStatus

use of org.olat.repository.RepositoryEntryStatus in project OpenOLAT by OpenOLAT.

the class CourseIndexer method doIndex.

@Override
public void doIndex(SearchResourceContext parentResourceContext, Object parentObject, OlatFullIndexer indexWriter) {
    RepositoryEntry repositoryEntry = (RepositoryEntry) parentObject;
    if (isLogDebugEnabled())
        logDebug("Analyse Course... repositoryEntry=" + repositoryEntry);
    try {
        RepositoryEntryStatus status = RepositoryManager.getInstance().createRepositoryEntryStatus(repositoryEntry.getStatusCode());
        if (status.isClosed()) {
            if (isLogDebugEnabled())
                logDebug("Course not indexed because it's closed: repositoryEntry=" + repositoryEntry);
            return;
        }
        ICourse course = CourseFactory.loadCourse(repositoryEntry);
        // course.getCourseTitle(); // do not index title => index root-node
        parentResourceContext.setParentContextType(TYPE);
        parentResourceContext.setParentContextName(course.getCourseTitle());
        doIndexCourse(parentResourceContext, course, course.getRunStructure().getRootNode(), indexWriter);
    } catch (CorruptedCourseException ex) {
        logWarn("Can not index repositoryEntry (" + repositoryEntry.getKey() + ")", ex);
    } catch (Exception ex) {
        logWarn("Can not index repositoryEntry=" + repositoryEntry, ex);
    }
}
Also used : CorruptedCourseException(org.olat.course.CorruptedCourseException) RepositoryEntryStatus(org.olat.repository.RepositoryEntryStatus) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) AssertException(org.olat.core.logging.AssertException) CorruptedCourseException(org.olat.course.CorruptedCourseException) StartupException(org.olat.core.logging.StartupException) IOException(java.io.IOException)

Example 2 with RepositoryEntryStatus

use of org.olat.repository.RepositoryEntryStatus in project openolat by klemens.

the class CourseIndexer method doIndex.

@Override
public void doIndex(SearchResourceContext parentResourceContext, Object parentObject, OlatFullIndexer indexWriter) {
    RepositoryEntry repositoryEntry = (RepositoryEntry) parentObject;
    if (isLogDebugEnabled())
        logDebug("Analyse Course... repositoryEntry=" + repositoryEntry);
    try {
        RepositoryEntryStatus status = RepositoryManager.getInstance().createRepositoryEntryStatus(repositoryEntry.getStatusCode());
        if (status.isClosed()) {
            if (isLogDebugEnabled())
                logDebug("Course not indexed because it's closed: repositoryEntry=" + repositoryEntry);
            return;
        }
        ICourse course = CourseFactory.loadCourse(repositoryEntry);
        // course.getCourseTitle(); // do not index title => index root-node
        parentResourceContext.setParentContextType(TYPE);
        parentResourceContext.setParentContextName(course.getCourseTitle());
        doIndexCourse(parentResourceContext, course, course.getRunStructure().getRootNode(), indexWriter);
    } catch (CorruptedCourseException ex) {
        logWarn("Can not index repositoryEntry (" + repositoryEntry.getKey() + ")", ex);
    } catch (Exception ex) {
        logWarn("Can not index repositoryEntry=" + repositoryEntry, ex);
    }
}
Also used : CorruptedCourseException(org.olat.course.CorruptedCourseException) RepositoryEntryStatus(org.olat.repository.RepositoryEntryStatus) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) AssertException(org.olat.core.logging.AssertException) CorruptedCourseException(org.olat.course.CorruptedCourseException) StartupException(org.olat.core.logging.StartupException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)2 AssertException (org.olat.core.logging.AssertException)2 StartupException (org.olat.core.logging.StartupException)2 CorruptedCourseException (org.olat.course.CorruptedCourseException)2 ICourse (org.olat.course.ICourse)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2 RepositoryEntryStatus (org.olat.repository.RepositoryEntryStatus)2