Search in sources :

Example 1 with IMSMetadataDocument

use of org.olat.search.service.document.file.IMSMetadataDocument in project openolat by klemens.

the class ScormRepositoryIndexer method createManifestDocument.

private Document createManifestDocument(VFSLeaf fManifest, Element rootElement, SearchResourceContext resourceContext) {
    IMSMetadataDocument document = new IMSMetadataDocument();
    document.setResourceUrl(resourceContext.getResourceUrl());
    if (isLogDebugEnabled())
        logDebug("MM: URL=" + document.getResourceUrl());
    document.setLastChange(new Date(fManifest.getLastModified()));
    document.setDocumentType(resourceContext.getDocumentType());
    if (StringHelper.containsNonWhitespace(resourceContext.getTitle())) {
        document.setTitle(resourceContext.getTitle());
    } else {
        document.setTitle(fManifest.getName());
    }
    document.setParentContextType(resourceContext.getParentContextType());
    document.setParentContextName(resourceContext.getParentContextName());
    StringBuilder sb = new StringBuilder();
    collectLangString(sb, rootElement);
    document.setContent(sb.toString());
    return document.getLuceneDocument();
}
Also used : IMSMetadataDocument(org.olat.search.service.document.file.IMSMetadataDocument) Date(java.util.Date)

Example 2 with IMSMetadataDocument

use of org.olat.search.service.document.file.IMSMetadataDocument in project OpenOLAT by OpenOLAT.

the class ScormRepositoryIndexer method createManifestDocument.

private Document createManifestDocument(VFSLeaf fManifest, Element rootElement, SearchResourceContext resourceContext) {
    IMSMetadataDocument document = new IMSMetadataDocument();
    document.setResourceUrl(resourceContext.getResourceUrl());
    if (isLogDebugEnabled())
        logDebug("MM: URL=" + document.getResourceUrl());
    document.setLastChange(new Date(fManifest.getLastModified()));
    document.setDocumentType(resourceContext.getDocumentType());
    if (StringHelper.containsNonWhitespace(resourceContext.getTitle())) {
        document.setTitle(resourceContext.getTitle());
    } else {
        document.setTitle(fManifest.getName());
    }
    document.setParentContextType(resourceContext.getParentContextType());
    document.setParentContextName(resourceContext.getParentContextName());
    StringBuilder sb = new StringBuilder();
    collectLangString(sb, rootElement);
    document.setContent(sb.toString());
    return document.getLuceneDocument();
}
Also used : IMSMetadataDocument(org.olat.search.service.document.file.IMSMetadataDocument) Date(java.util.Date)

Aggregations

Date (java.util.Date)2 IMSMetadataDocument (org.olat.search.service.document.file.IMSMetadataDocument)2