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

OO-3611: closed courses first in closed, deduplicate courses in _other

parent 5edad7db
No related branches found
No related tags found
No related merge requests found
...@@ -184,7 +184,13 @@ class CoursefolderWebDAVMergeSource extends WebDAVMergeSource { ...@@ -184,7 +184,13 @@ class CoursefolderWebDAVMergeSource extends WebDAVMergeSource {
termed = true; termed = true;
} }
if(namingAndGrouping.isUseCurriculumElementsTerms() && namingAndGrouping.hasCurriculumElements(re)) { if(namingAndGrouping.isUseManaged() && re.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
String courseTitle = getCourseTitle(re, namingAndGrouping.isPrependReference());
String name = namingAndGrouping.getNoTermUniqueName(courseTitle);
NamedContainerImpl cfContainer = new CoursefolderWebDAVNamedContainer(name, re, editor ? null : identityEnv);
noTermContainer.add(re, cfContainer);
termed = true;
} else if(namingAndGrouping.isUseCurriculumElementsTerms() && namingAndGrouping.hasCurriculumElements(re)) {
List<CurriculumElementWebDAVInfos> elements = namingAndGrouping.getCurriculumElementInfos().get(re.getKey()); List<CurriculumElementWebDAVInfos> elements = namingAndGrouping.getCurriculumElementInfos().get(re.getKey());
for(CurriculumElementWebDAVInfos element:elements) { for(CurriculumElementWebDAVInfos element:elements) {
String termSoftKey = getTermSoftKey(element); String termSoftKey = getTermSoftKey(element);
...@@ -238,6 +244,7 @@ class CoursefolderWebDAVMergeSource extends WebDAVMergeSource { ...@@ -238,6 +244,7 @@ class CoursefolderWebDAVMergeSource extends WebDAVMergeSource {
private static class NoTermContainer { private static class NoTermContainer {
private final Set<RepositoryEntry> entriesSet = new HashSet<>();
private final VirtualContainer noTermContainer = new VirtualContainer("_other"); private final VirtualContainer noTermContainer = new VirtualContainer("_other");
private final VirtualContainer finishedContainer = new VirtualContainer("_finished"); private final VirtualContainer finishedContainer = new VirtualContainer("_finished");
...@@ -306,6 +313,11 @@ class CoursefolderWebDAVMergeSource extends WebDAVMergeSource { ...@@ -306,6 +313,11 @@ class CoursefolderWebDAVMergeSource extends WebDAVMergeSource {
} }
public void add(RepositoryEntry entry, VFSContainer container) { public void add(RepositoryEntry entry, VFSContainer container) {
if(entriesSet.contains(entry)) {
return;
} else {
entriesSet.add(entry);
}
if(namingAndGrouping.isUseManaged()) { if(namingAndGrouping.isUseManaged()) {
if(StringHelper.containsNonWhitespace(entry.getManagedFlagsString())) { if(StringHelper.containsNonWhitespace(entry.getManagedFlagsString())) {
if(entry.getEntryStatus() == RepositoryEntryStatusEnum.closed) { if(entry.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
......
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