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);
}
}
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);
}
}
Aggregations