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

Merge OpenOLAT 8.4 to OpenOLAT 9.0 with 2f2a6abaea034f44671c9c1c6529c687e51ff300

parents 0fe9f89a 924f6783
No related branches found
No related tags found
No related merge requests found
...@@ -179,6 +179,7 @@ public class ClusterLocker implements Locker, GenericEventListener { ...@@ -179,6 +179,7 @@ public class ClusterLocker implements Locker, GenericEventListener {
* Use 'releaseLock' as method to release a lock. * Use 'releaseLock' as method to release a lock.
* @param lock release this lockentry * @param lock release this lockentry
*/ */
@Override
public void releaseLockEntry(LockEntry lockEntry) { public void releaseLockEntry(LockEntry lockEntry) {
String asset = lockEntry.getKey(); String asset = lockEntry.getKey();
Identity releaseRequestor = lockEntry.getOwner(); Identity releaseRequestor = lockEntry.getOwner();
...@@ -193,7 +194,7 @@ public class ClusterLocker implements Locker, GenericEventListener { ...@@ -193,7 +194,7 @@ public class ClusterLocker implements Locker, GenericEventListener {
} else { } else {
// check that entry was previously locked by the same user that now wants to release the lock. // check that entry was previously locked by the same user that now wants to release the lock.
Identity ownwer = li.getOwner(); Identity ownwer = li.getOwner();
if (releaseRequestor.getName().equals(ownwer.getName())) { if (releaseRequestor.getKey().equals(ownwer.getKey())) {
// delete the lock // delete the lock
clusterLockManager.deleteLock(li); clusterLockManager.deleteLock(li);
} else { } else {
......
...@@ -40,6 +40,7 @@ import org.apache.lucene.search.TopDocs; ...@@ -40,6 +40,7 @@ import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.highlight.Highlighter; import org.apache.lucene.search.highlight.Highlighter;
import org.apache.lucene.search.highlight.InvalidTokenOffsetsException; import org.apache.lucene.search.highlight.InvalidTokenOffsetsException;
import org.apache.lucene.search.highlight.QueryScorer; import org.apache.lucene.search.highlight.QueryScorer;
import org.apache.lucene.search.highlight.SimpleHTMLEncoder;
import org.apache.lucene.search.highlight.SimpleHTMLFormatter; import org.apache.lucene.search.highlight.SimpleHTMLFormatter;
import org.olat.core.commons.persistence.DBFactory; import org.olat.core.commons.persistence.DBFactory;
import org.olat.core.id.Identity; import org.olat.core.id.Identity;
...@@ -255,7 +256,8 @@ public class SearchResultsImpl implements SearchResults { ...@@ -255,7 +256,8 @@ public class SearchResultsImpl implements SearchResults {
* @throws IOException * @throws IOException
*/ */
private void doHighlight(Query query, Analyzer analyzer, Document doc, ResultDocument resultDocument) throws IOException { private void doHighlight(Query query, Analyzer analyzer, Document doc, ResultDocument resultDocument) throws IOException {
Highlighter highlighter = new Highlighter(new SimpleHTMLFormatter(HIGHLIGHT_PRE_TAG,HIGHLIGHT_POST_TAG) , new QueryScorer(query)); Highlighter highlighter = new Highlighter(new SimpleHTMLFormatter(HIGHLIGHT_PRE_TAG,HIGHLIGHT_POST_TAG) ,
new SimpleHTMLEncoder(), new QueryScorer(query));
// Get 3 best fragments of content and seperate with a "..." // Get 3 best fragments of content and seperate with a "..."
try { try {
//highlight content //highlight content
......
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