Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSL utility / Add function to retrieve thesaurus URI #8456

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions core/src/main/java/org/fao/geonet/util/XslUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ public static String getThesaurusIdByTitle(String title) {

return thesaurus == null ? "" : "geonetwork.thesaurus." + thesaurus.getKey();
}

/**
* Retrieve the thesaurus title using the thesaurus key.
*
Expand All @@ -1455,6 +1455,15 @@ public static String getThesaurusTitleByKey(String id) {
}


public static String getThesaurusUriByKey(String id) {
ApplicationContext applicationContext = ApplicationContextHolder.get();
ThesaurusManager thesaurusManager = applicationContext.getBean(ThesaurusManager.class);
Thesaurus thesaurus = thesaurusManager.getThesaurusByName(id);
return thesaurus == null ? "" : thesaurus.getDefaultNamespace();
}



/**
* Utility method to retrieve the name (label) for an iso language using it's code for a specific language.
* <p>
Expand Down Expand Up @@ -1594,7 +1603,7 @@ private static List<Element> buildRecordLink(List<Hit> hits, String type) {
public static String escapeForJson(String value) {
return StringEscapeUtils.escapeJson(value);
}

public static String getWebAnalyticsService() {
ApplicationContext applicationContext = ApplicationContextHolder.get();
WebAnalyticsConfiguration webAnalyticsConfiguration = applicationContext.getBean(WebAnalyticsConfiguration.class);
Expand Down