Skip to content
Snippets Groups Projects
Commit af15e885 authored by srosse's avatar srosse
Browse files

Merge remote-tracking branch 'origin/OpenOLAT_15.1'

parents 7a3aac64 be521691
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,7 @@ public class HtmlFilter implements Filter {
if (in == null) return null;
try {
HtmlParser parser = new HtmlParser(XmlViolationPolicy.ALTER_INFOSET);
HtmlHandler contentHandler = new HtmlHandler((int)(1000 * 0.66f), false);
HtmlHandler contentHandler = new HtmlHandler(8096, false);
parser.setContentHandler(contentHandler);
parser.parse(new InputSource(in));
return contentHandler.getContent();
......
......@@ -227,6 +227,13 @@ public class AuthenticatedDispatcher implements Dispatcher {
log.error("Unsupported encoding", e);
}
if(restPart == null) {
return null;
}
int index = restPart.indexOf(";jsessionid=");
if(index >= 0) {
restPart = restPart.substring(0, index);
}
if(restPart.startsWith("repo/go")) {
return convertJumpInURL(ureq);
}
......
......@@ -74,7 +74,7 @@ data.collection.topic.repository=Kurs
data.collection.topic.repository.name=Kurs
data.collection.topic.repository.none=Kein Kurs ausgew\u00E4lt
data.collection.topic.repository.select=Select
data.collection.topic.title=Beurteilungsgsgenstand
data.collection.topic.title=Beurteilungsgegenstand
data.collection.topic.type=Gegenstandsart
data.collection.topic.type.select=Gegenstandsart
data.collections=Datenerhebungen
......@@ -112,7 +112,7 @@ executor.participation.status.ready=Bereit
executor.participation.taxonomy.level=Taxonomieebene
executor.participation.title=$\:data.collection.title
executor.participation.topic=$\:data.collection.topic
executor.participation.topic.title=Beurteilungsgsgenstand
executor.participation.topic.title=Beurteilungsgegenstand
executor.participation.topic.type=$\:data.collection.topic.type
goto.analysis.help=\u00D6ffnen Sie das Analyse-Werkzeug, um die Antworten der Datenerhebungen zu filtern, zu visualisieren und zu analysieren oder \u00F6ffnen Sie eine vordefinierte Ansicht.
goto.analysis.link=Analyse-Werkzeug \u00F6ffnen
......
......@@ -29,10 +29,10 @@ package org.olat.search.service.indexer;
import java.io.IOException;
import java.util.concurrent.Callable;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.document.Document;
import org.olat.core.CoreSpringFactory;
import org.olat.core.commons.persistence.DBFactory;
import org.apache.logging.log4j.Logger;
import org.olat.core.logging.Tracing;
import org.olat.core.util.vfs.VFSContainer;
import org.olat.core.util.vfs.VFSItem;
......@@ -86,27 +86,28 @@ public class FolderIndexerWorker implements Callable<Boolean> {
throws IOException, InterruptedException {
// Items: List of VFSContainer & VFSLeaf
String myFilePath = fPath;
boolean debug = log.isDebugEnabled();
for (VFSItem item : cont.getItems(new VFSSystemItemFilter())) {
if (item instanceof VFSContainer) {
// ok it is a container go further
if (log.isDebugEnabled()) log.debug(item.getName() + " is a VFSContainer => go further ");
if (debug) log.debug("{} is a VFSContainer => go further ", item.getName());
if(aRule.allowed(item)) {
doIndexVFSContainer(resourceContext, (VFSContainer)item, writer, myFilePath + "/" + ((VFSContainer)item).getName(), aRule);
}
} else if (item instanceof VFSLeaf) {
// ok it is a file => analyse it
if (log.isDebugEnabled()) log.debug(item.getName() + " is a VFSLeaf => analyse file");
if (debug) log.debug("{} is a VFSLeaf => analyse file", item.getName() );
if(aRule.allowed(item)) {
doIndexVFSLeaf(resourceContext, (VFSLeaf)item, writer, myFilePath);
}
} else {
log.warn("Unkown element in item-list class=" + item.getClass());
log.warn("Unkown element in item-list class={}", item.getClass());
}
}
}
protected void doIndexVFSLeaf(SearchResourceContext leafResourceContext, VFSLeaf leaf, OlatFullIndexer writer, String fPath) {
if (log.isDebugEnabled()) log.debug("Analyse VFSLeaf=" + leaf.getName());
if (log.isDebugEnabled()) log.debug("Analyse VFSLeaf={}", leaf.getName());
try {
if (docFactory.isFileSupported(leaf)) {
String myFilePath = fPath + "/" + leaf.getName();
......@@ -116,16 +117,16 @@ public class FolderIndexerWorker implements Callable<Boolean> {
writer.addDocument(document);
}
} else {
if (log.isDebugEnabled()) log.debug("Documenttype not supported. file=" + leaf.getName());
if (log.isDebugEnabled()) log.debug("Documenttype not supported. file={}", leaf.getName());
}
} catch (DocumentAccessException e) {
if (log.isDebugEnabled()) log.debug("Can not access document." + e.getMessage());
if (log.isDebugEnabled()) log.debug("Can not access document.", e);
} catch (InterruptedException e) {
if (log.isDebugEnabled()) log.debug("InterruptedException: Can not index leaf=" + leaf.getName() + ";" + e.getMessage());
if (log.isDebugEnabled()) log.debug("InterruptedException: Can not index leaf={}", leaf.getName(), e);
} catch (IOException ioEx) {
log.warn("IOException: Can not index leaf=" + leaf.getName(), ioEx);
log.warn("IOException: Can not index leaf={}", leaf.getName(), ioEx);
} catch (Exception ex) {
log.warn("Exception: Can not index leaf=" + leaf.getName(), ex);
log.warn("Exception: Can not index leaf={}", leaf.getName(), ex);
}
}
......
......@@ -50,7 +50,7 @@ public class ImsCPRepositoryIndexer extends FolderIndexer {
private static final Logger log = Tracing.createLoggerFor(ImsCPRepositoryIndexer.class);
// Must correspond with LocalString_xx.properties
// Do not use '_' because we want to seach for certain documenttype and lucene haev problems with '_'
// Do not use '_' because we want to search for certain document types and lucene has problems with '_'
public static final String TYPE = "type.repository.entry.imscp";
public static final String ORES_TYPE_CP = ImsCPFileResource.TYPE_NAME;
......@@ -59,10 +59,7 @@ public class ImsCPRepositoryIndexer extends FolderIndexer {
public String getSupportedTypeName() {
return ORES_TYPE_CP;
}
/**
* @see org.olat.repository.handlers.RepositoryHandler#supportsDownload()
*/
@Override
public void doIndex(SearchResourceContext resourceContext, Object parentObject, OlatFullIndexer indexWriter) throws IOException,InterruptedException {
RepositoryEntry repositoryEntry = (RepositoryEntry) parentObject;
......
......@@ -21,7 +21,6 @@ package org.olat.search.service.indexer.repository;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
......@@ -59,41 +58,26 @@ public class ScormRepositoryIndexer extends FolderIndexer {
private static final Logger log = Tracing.createLoggerFor(ScormRepositoryIndexer.class);
public static Set<String> stopWords = new HashSet<>();
private static final Set<String> stopWords = new HashSet<>();
static {
stopWords.add("LOMv1.0");
stopWords.add("yes");
stopWords.add("NA");
}
public static final List<String> forbiddenExtensions = new ArrayList<>();
static {
forbiddenExtensions.add("LOMv1.0");
forbiddenExtensions.add(".xsd");
forbiddenExtensions.add(".js");
}
public static final Set<String> forbiddenFiles = new HashSet<>();
static {
forbiddenFiles.add("imsmanifest.xml");
}
public static final String TYPE = "type.repository.entry.scorm";
public static final String ORES_TYPE_SCORM = ScormCPFileResource.TYPE_NAME;
public ScormRepositoryIndexer() {
// Repository types
}
/**
*
*/
@Override
public String getSupportedTypeName() {
return ORES_TYPE_SCORM;
}
/**
* @see org.olat.repository.handlers.RepositoryHandler#supportsDownload()
*/
@Override
public void doIndex(SearchResourceContext resourceContext, Object parentObject, OlatFullIndexer indexWriter)
throws IOException,InterruptedException {
if (log.isDebugEnabled()) log.debug("Index Scorm package...");
......@@ -123,7 +107,7 @@ public class ScormRepositoryIndexer extends FolderIndexer {
private Document createManifestDocument(VFSLeaf fManifest, Element rootElement, SearchResourceContext resourceContext) {
IMSMetadataDocument document = new IMSMetadataDocument();
document.setResourceUrl(resourceContext.getResourceUrl());
if (log.isDebugEnabled()) log.debug("MM: URL=" + document.getResourceUrl());
if (log.isDebugEnabled()) log.debug("MM: URL={}", document.getResourceUrl());
document.setLastChange(new Date(fManifest.getLastModified()));
document.setDocumentType(resourceContext.getDocumentType());
if (StringHelper.containsNonWhitespace(resourceContext.getTitle())) {
......@@ -134,8 +118,6 @@ public class ScormRepositoryIndexer extends FolderIndexer {
document.setParentContextType(resourceContext.getParentContextType());
document.setParentContextName(resourceContext.getParentContextName());
StringBuilder sb = new StringBuilder();
collectLangString(sb, rootElement);
document.setContent(sb.toString());
......@@ -157,21 +139,14 @@ public class ScormRepositoryIndexer extends FolderIndexer {
}
}
public class ScormFileAccess implements FolderIndexerAccess {
private static class ScormFileAccess implements FolderIndexerAccess {
@Override
public boolean allowed(VFSItem item) {
String name = item.getName();
if(forbiddenFiles.contains(name)) {
return false;
}
for(String forbiddenExtension:forbiddenExtensions) {
if(name.endsWith(forbiddenExtension)) {
return false;
}
String name = item.getName().toLowerCase();
if(item instanceof VFSContainer) {
return !name.equals("template");
}
return true;
return name.endsWith(".htm") || name.endsWith(".html");
}
}
}
......@@ -43,8 +43,8 @@ import org.olat.search.service.indexer.repository.ScormRepositoryIndexer;
* @author srosse, stephane.rosse@frentix.com
*/
public class ScormCourseNodeIndexer extends ScormRepositoryIndexer implements CourseNodeIndexer {
public final static String NODE_TYPE = "type.course.node.scorm";
private final static String SUPPORTED_TYPE_NAME = "org.olat.course.nodes.ScormCourseNode";
public static final String NODE_TYPE = "type.course.node.scorm";
private static final String SUPPORTED_TYPE_NAME = "org.olat.course.nodes.ScormCourseNode";
@Override
public void doIndex(SearchResourceContext repositoryResourceContext, ICourse course, CourseNode courseNode, OlatFullIndexer indexWriter)
......
......@@ -78,11 +78,7 @@ public class LoginPage {
}
public void assertLoggedIn(UserVO user) {
WebElement username = browser.findElement(usernameFooterBy);
Assert.assertNotNull(username);
Assert.assertTrue(username.isDisplayed());
String name = username.getText();
Assert.assertTrue(name.contains(user.getLastName()));
assertLoggedInByLastName(user.getLastName());
}
public void assertLoggedInByLastName(String lastName) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment