Skip to content

Commit

Permalink
set related rel for supplementary links only
Browse files Browse the repository at this point in the history
  • Loading branch information
HavierD committed Sep 13, 2024
1 parent 0d1b2e8 commit fca3bbe
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,16 @@ List<LinkModel> mapLinks(MDMetadataType source) {
linkModel.setType(Objects.equals(ciOnlineResource.getProtocol().getCharacterString().getValue().toString(), "WWW:LINK-1.0-http--link") ? "text/html" : "");
}
linkModel.setHref(ciOnlineResource.getLinkage().getCharacterString().getValue().toString());
linkModel.setRel(RelationType.RELATED.getValue());
safeGet(() -> ciOnlineResource.getProtocol().getCharacterString().getValue().toString())
.ifPresent(protocol -> {

// only supplementary links are related (need to be displayed
// in the link panel)
if (LinkUtils.isSupplementaryLink(protocol)) {
linkModel.setRel(RelationType.RELATED.getValue());
}
});

linkModel.setTitle(getOnlineResourceName(ciOnlineResource));
results.add(linkModel);
}
Expand Down

0 comments on commit fca3bbe

Please sign in to comment.