Commit cd962d48 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

414: Fix issues with loading collection and resources images (OPENED)

Task-Url: #414
parent 07f3a255
Pipeline #23197 failed with stage
in 10 seconds
......@@ -96,6 +96,8 @@ public class CollectionSyncService extends BaseSyncService<Collection, Collectio
boolean saveCollection;
List<Endpoint> collectionEndpoints;
List<Dataset> endpointDatasets;
List<String> cmCollection;
Matcher m;
for (Collection c : collections) {
// Deletions can be executed right away
if (c.isDeleted()) {
......@@ -133,6 +135,14 @@ public class CollectionSyncService extends BaseSyncService<Collection, Collectio
e.getDatasets().remove(ds);
}
}
if (c.getImageUrl()!=null && ( c.isNew() || c.isUpdate() || ds.isNew() )) {
m = Constants.ONLINE_FILE_PATTERN.matcher(c.getImageUrl());
if (m.matches()) {
cmCollection = new ArrayList<>();
cmCollection.add(c.getImageUrl());
cachedImageService.cacheImage(c.getId(), e.getId(), ds.getId(), null, cmCollection);
}
}
}
}
}
......@@ -145,16 +155,6 @@ public class CollectionSyncService extends BaseSyncService<Collection, Collectio
if (saveCollection) {
this.collectionService.saveCollection(c);
if (c.getImageUrl()!=null) {
Matcher m = Constants.ONLINE_FILE_PATTERN.matcher(c.getImageUrl());
if (m.matches()) {
List<String> cmCollection = new ArrayList<>();
cmCollection.add(c.getImageUrl());
cachedImageService.cacheImage(c.getId(), null, null, null, cmCollection);
}
}
}
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="Console"
class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d{yyyy-MM-dd} %d{HH:mm:ss.SSS} %thread | %5p %logger{36}.%M\(%line\) - %m%n</pattern>
</layout>
</appender>
<!-- LOG everything at INFO level -->
<root level="info">
<appender-ref ref="Console" />
</root>
<logger name="eu.dariah.de">
<level value="debug" />
</logger>
<logger name="org.pac4j">
<level value="debug" />
</logger>
</configuration>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment