mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 18:14:26 +00:00
Add a configuration key to disable hierarchical browse indexes
This commit is contained in:
@@ -17,6 +17,7 @@ import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.DCInput;
|
||||
@@ -557,6 +558,15 @@ public final class ChoiceAuthorityServiceImpl implements ChoiceAuthorityService
|
||||
init();
|
||||
ChoiceAuthority source = this.getChoiceAuthorityByAuthorityName(nameVocab);
|
||||
if (source != null && source instanceof DSpaceControlledVocabulary) {
|
||||
|
||||
// First, check if this vocabulary index is disabled
|
||||
String[] vocabulariesDisabled = configurationService
|
||||
.getArrayProperty("webui.browse.vocabularies.disabled");
|
||||
if (vocabulariesDisabled != null && ArrayUtils.contains(vocabulariesDisabled, nameVocab)) {
|
||||
// Discard this vocabulary browse index
|
||||
return null;
|
||||
}
|
||||
|
||||
Set<String> metadataFields = new HashSet<>();
|
||||
Map<String, List<String>> formsToFields = this.authoritiesFormDefinitions.get(nameVocab);
|
||||
for (Map.Entry<String, List<String>> formToField : formsToFields.entrySet()) {
|
||||
|
@@ -1158,6 +1158,11 @@ webui.browse.index.4 = subject:metadata:dc.subject.*:text
|
||||
## example of authority-controlled browse category - see authority control config
|
||||
#webui.browse.index.5 = lcAuthor:metadataAuthority:dc.contributor.author:authority
|
||||
|
||||
# By default, browse hierarchical indexes are created based on the used controlled
|
||||
# vocabularies in the submission forms. These could be disabled adding the name of
|
||||
# the vocabularies to exclude in this comma-separated property:
|
||||
# webui.browse.vocabularies.disabled = srsc
|
||||
|
||||
# Enable/Disable tag cloud in browsing.
|
||||
# webui.browse.index.tagcloud.<n> = true | false
|
||||
# where n is the index number from the above options
|
||||
|
Reference in New Issue
Block a user