Skip to content
Snippets Groups Projects
Commit e2363eca authored by uhensler's avatar uhensler
Browse files

OO-2893: Make the auto booking work with internalId and externalId

parent 52e922ed
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,6 @@ package org.olat.resource.accesscontrol.provider.auto.manager; ...@@ -21,7 +21,6 @@ package org.olat.resource.accesscontrol.provider.auto.manager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -94,7 +93,7 @@ class AdvanceOrderDAO { ...@@ -94,7 +93,7 @@ class AdvanceOrderDAO {
} }
Collection<AdvanceOrder> loadPendingAdvanceOrders(Map<IdentifierKey, String> identifiers) { Collection<AdvanceOrder> loadPendingAdvanceOrders(Map<IdentifierKey, String> identifiers) {
if (identifiers == null || identifiers.isEmpty()) return Collections.<AdvanceOrder>emptyList(); if (identifiers == null || identifiers.isEmpty()) return new ArrayList<>();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("select advanceOrder from advanceOrder advanceOrder") sb.append("select advanceOrder from advanceOrder advanceOrder")
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
*/ */
package org.olat.resource.accesscontrol.provider.auto.manager; package org.olat.resource.accesscontrol.provider.auto.manager;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -106,7 +106,7 @@ public class AutoAccessManagerImpl implements AutoAccessManager { ...@@ -106,7 +106,7 @@ public class AutoAccessManagerImpl implements AutoAccessManager {
@Override @Override
public Collection<AdvanceOrder> loadPendingAdvanceOrders(RepositoryEntry entry) { public Collection<AdvanceOrder> loadPendingAdvanceOrders(RepositoryEntry entry) {
if (entry == null) return Collections.<AdvanceOrder>emptyList(); if (entry == null) return new ArrayList<>();
Map<IdentifierKey, String> searchValues = new EnumMap<>(IdentifierKey.class); Map<IdentifierKey, String> searchValues = new EnumMap<>(IdentifierKey.class);
for (IdentifierKey key: IdentifierKey.values()) { for (IdentifierKey key: IdentifierKey.values()) {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
*/ */
package org.olat.resource.accesscontrol.provider.auto.manager; package org.olat.resource.accesscontrol.provider.auto.manager;
import java.util.Collections; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryEntry;
...@@ -47,7 +47,7 @@ class ExternalIdHandler implements IdentifierKeyHandler { ...@@ -47,7 +47,7 @@ class ExternalIdHandler implements IdentifierKeyHandler {
@Override @Override
public List<RepositoryEntry> find(String value) { public List<RepositoryEntry> find(String value) {
List<RepositoryEntry> entries = Collections.emptyList();; List<RepositoryEntry> entries = new ArrayList<>();
try { try {
entries = repositoryService.loadRepositoryEntriesByExternalId(value); entries = repositoryService.loadRepositoryEntriesByExternalId(value);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
*/ */
package org.olat.resource.accesscontrol.provider.auto.manager; package org.olat.resource.accesscontrol.provider.auto.manager;
import java.util.Collections; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryEntry;
...@@ -47,7 +47,7 @@ class ExternalRefHandler implements IdentifierKeyHandler { ...@@ -47,7 +47,7 @@ class ExternalRefHandler implements IdentifierKeyHandler {
@Override @Override
public List<RepositoryEntry> find(String value) { public List<RepositoryEntry> find(String value) {
List<RepositoryEntry> entries = Collections.<RepositoryEntry>emptyList();; List<RepositoryEntry> entries = new ArrayList<>();
try { try {
entries = repositoryService.loadRepositoryEntriesByExternalRef(value); entries = repositoryService.loadRepositoryEntriesByExternalRef(value);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
*/ */
package org.olat.resource.accesscontrol.provider.auto.manager; package org.olat.resource.accesscontrol.provider.auto.manager;
import java.util.Collections; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryEntry;
...@@ -41,12 +41,12 @@ class InternalIdHandler implements IdentifierKeyHandler { ...@@ -41,12 +41,12 @@ class InternalIdHandler implements IdentifierKeyHandler {
@Override @Override
public IdentifierKey getIdentifierKey() { public IdentifierKey getIdentifierKey() {
return IdentifierKey.externalId; return IdentifierKey.internalId;
} }
@Override @Override
public List<RepositoryEntry> find(String value) { public List<RepositoryEntry> find(String value) {
List<RepositoryEntry> entries = Collections.<RepositoryEntry>emptyList(); List<RepositoryEntry> entries = new ArrayList<>();
try { try {
Long repositoryEntryKey = Long.parseLong(value); Long repositoryEntryKey = Long.parseLong(value);
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
*/ */
package org.olat.resource.accesscontrol.provider.auto.manager; package org.olat.resource.accesscontrol.provider.auto.manager;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -44,7 +44,7 @@ public class SemicolonSplitter implements IdentifierValueSplitter { ...@@ -44,7 +44,7 @@ public class SemicolonSplitter implements IdentifierValueSplitter {
@Override @Override
public Collection<String> split(String rawValue) { public Collection<String> split(String rawValue) {
if (rawValue == null) return Collections.<String>emptyList(); if (rawValue == null) return new ArrayList<>();
return Arrays.asList(rawValue.split(";")); return Arrays.asList(rawValue.split(";"));
} }
......
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