104 |
104 |
// binder.registerCustomEditor(DefinedTermBaseList.class, new TermBaseListPropertyEditor<>(termService));
|
105 |
105 |
}
|
106 |
106 |
|
107 |
|
|
108 |
107 |
@Autowired
|
109 |
|
TaxonPortalController taxonPortalController;
|
|
108 |
private TaxonPortalController taxonPortalController;
|
110 |
109 |
|
111 |
110 |
@Autowired
|
112 |
|
ITermService termService;
|
|
111 |
private ITermService termService;
|
113 |
112 |
|
114 |
113 |
@Autowired
|
115 |
|
IMediaToolbox mediaTools;
|
|
114 |
private IMediaToolbox mediaTools;
|
116 |
115 |
|
117 |
116 |
private String[] thumbnailMimetypes = new String[] {"image/.*", ".*"};
|
118 |
117 |
|
119 |
118 |
/**
|
120 |
|
* Universalviewer only shows one attribution value in the popup panel
|
|
119 |
* Universal viewer only shows one attribution value in the popup panel
|
121 |
120 |
* Therefore it makes sense to join all of them.
|
122 |
121 |
*/
|
123 |
122 |
private boolean doJoinAttributions = true;
|
... | ... | |
341 |
340 |
}
|
342 |
341 |
}
|
343 |
342 |
|
344 |
|
/**
|
345 |
|
* @param canvas
|
346 |
|
*/
|
347 |
343 |
private void orderMedatadaItems(Canvas canvas) {
|
348 |
344 |
// TODO Auto-generated method stub
|
349 |
345 |
// order by label name, Title, description, author, license, attribution should come first.
|
350 |
346 |
}
|
351 |
347 |
|
352 |
|
|
353 |
|
/**
|
354 |
|
* @param mediaMetadata
|
355 |
|
* @return
|
356 |
|
*/
|
357 |
348 |
private List<MetadataEntry> deduplicateMetadata(List<MetadataEntry> mediaMetadata) {
|
358 |
349 |
Map<String, MetadataEntry> dedupMap = new HashMap<>();
|
359 |
350 |
mediaMetadata.stream().forEach(mde -> {
|
... | ... | |
361 |
352 |
dedupMap.put(dedupKey, mde);
|
362 |
353 |
}
|
363 |
354 |
);
|
364 |
|
return new ArrayList<MetadataEntry>(dedupMap.values());
|
|
355 |
return new ArrayList<>(dedupMap.values());
|
365 |
356 |
}
|
366 |
357 |
|
367 |
|
/**
|
368 |
|
* @param canvas
|
369 |
|
* @param mediaMetadata
|
370 |
|
*/
|
371 |
|
void extractAndAddDesciptions(Resource resource, List<MetadataEntry> mediaMetadata) {
|
|
358 |
private void extractAndAddDesciptions(Resource resource, List<MetadataEntry> mediaMetadata) {
|
372 |
359 |
List<MetadataEntry> descriptions = mediaMetadata.stream()
|
373 |
360 |
.filter(mde -> mde.getLabelString().toLowerCase().matches(".*description.*|.*caption.*"))
|
374 |
361 |
.collect(Collectors.toList());
|
... | ... | |
378 |
365 |
descriptions.stream().forEach(mde -> resource.addDescription(mde.getValueString()));
|
379 |
366 |
}
|
380 |
367 |
|
381 |
|
/**
|
382 |
|
* @param entity
|
383 |
|
* @return
|
384 |
|
*/
|
385 |
368 |
private <T extends IdentifiableEntity> List<MetadataEntry> entityMetadata(T entity) {
|
386 |
369 |
|
387 |
370 |
List<MetadataEntry> metadata = new ArrayList<>();
|
... | ... | |
557 |
540 |
return resource;
|
558 |
541 |
}
|
559 |
542 |
|
560 |
|
/**
|
561 |
|
* @param right
|
562 |
|
* @return
|
563 |
|
*/
|
564 |
|
String htmlLink(URI uri, String text) {
|
|
543 |
private String htmlLink(URI uri, String text) {
|
565 |
544 |
return String.format(" <a href=\"%s\">%s</a>", uri, text);
|
566 |
545 |
}
|
567 |
546 |
|
568 |
|
/**
|
569 |
|
* @param thumbnailRepresentation
|
570 |
|
* @return
|
571 |
|
*/
|
572 |
547 |
private List<ImageContent> representationPartsToImageContent(MediaRepresentation representation) {
|
573 |
548 |
List<ImageContent> imageContents = new ArrayList<>();
|
574 |
549 |
for(MediaRepresentationPart part : representation.getParts()){
|
cleanup