public final class ChoiceAuthorityServiceImpl extends Object implements ChoiceAuthorityService
# names the ChoiceAuthority plugin called for this field
choices.plugin.<FIELD> = name-of-plugin
# mode of UI presentation desired in submission UI:
# "select" is dropdown menu, "lookup" is popup with selector, "suggest" is autocomplete/suggest
choices.presentation.<FIELD> = "select" | "suggest"
# is value "closed" to the set of these choices or are non-authority values permitted?
choices.closed.<FIELD> = true | false
ChoiceAuthority| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Boolean> |
closed |
protected ConfigurationService |
configurationService |
protected Map<String,ChoiceAuthority> |
controller |
protected PluginService |
pluginService |
protected Map<String,String> |
presentation |
| Modifier | Constructor and Description |
|---|---|
protected |
ChoiceAuthorityServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
config2fkey(String field) |
Choices |
getBestMatch(String fieldKey,
String query,
Collection collection,
String locale)
Wrapper that calls getBestMatch method of the plugin corresponding to
the metadata field defined by single field key.
|
String |
getLabel(MetadataValue metadataValue,
String locale)
Wrapper that calls getLabel method of the plugin corresponding to
the metadata field defined by schema,element,qualifier.
|
String |
getLabel(String fieldKey,
String authKey,
String locale)
Wrapper that calls getLabel method of the plugin corresponding to
the metadata field defined by single field key.
|
Choices |
getMatches(String fieldKey,
String query,
Collection collection,
int start,
int limit,
String locale)
Wrapper calls getMatches method of the plugin corresponding to
the metadata field defined by single field key.
|
Choices |
getMatches(String fieldKey,
String query,
Collection collection,
int start,
int limit,
String locale,
boolean externalInput) |
Choices |
getMatches(String schema,
String element,
String qualifier,
String query,
Collection collection,
int start,
int limit,
String locale)
Wrapper that calls getMatches method of the plugin corresponding to
the metadata field defined by schema,element,qualifier.
|
String |
getPresentation(String fieldKey)
Get the presentation keyword (should be "lookup", "select" or "suggest", but this
is an informal convention so it can be easily extended) for this field.
|
List<String> |
getVariants(MetadataValue metadataValue)
Wrapper to call plugin's getVariants().
|
boolean |
isChoicesConfigured(String fieldKey)
Predicate, is there a Choices configuration of any kind for the
given metadata field?
|
boolean |
isClosed(String fieldKey)
Get the configured "closed" value for this field.
|
protected String |
makeFieldKey(String schema,
String element,
String qualifier) |
protected Map<String,ChoiceAuthority> controller
@Autowired(required=true) protected ConfigurationService configurationService
@Autowired(required=true) protected PluginService pluginService
public Choices getMatches(String schema, String element, String qualifier, String query, Collection collection, int start, int limit, String locale)
ChoiceAuthorityServicegetMatches in interface ChoiceAuthorityServiceschema - schema of metadata fieldelement - element of metadata fieldqualifier - qualifier of metadata fieldquery - user's value to matchcollection - database ID of Collection for context (owner of Item)start - choice at which to start, 0 is first.limit - maximum number of choices to return, 0 for no limit.locale - explicit localization key if available, or nullChoiceAuthority.getMatches(java.lang.String, java.lang.String, org.dspace.content.Collection, int, int, java.lang.String)public Choices getMatches(String fieldKey, String query, Collection collection, int start, int limit, String locale)
ChoiceAuthorityServicegetMatches in interface ChoiceAuthorityServicefieldKey - single string identifying metadata fieldquery - user's value to matchcollection - database ID of Collection for context (owner of Item)start - choice at which to start, 0 is first.limit - maximum number of choices to return, 0 for no limit.locale - explicit localization key if available, or nullChoiceAuthority.getMatches(java.lang.String, java.lang.String, org.dspace.content.Collection, int, int, java.lang.String)public Choices getMatches(String fieldKey, String query, Collection collection, int start, int limit, String locale, boolean externalInput)
getMatches in interface ChoiceAuthorityServicepublic Choices getBestMatch(String fieldKey, String query, Collection collection, String locale)
ChoiceAuthorityServicegetBestMatch in interface ChoiceAuthorityServicefieldKey - single string identifying metadata fieldquery - user's value to matchcollection - database ID of Collection for context (owner of Item)locale - explicit localization key if available, or nullChoiceAuthority.getBestMatch(java.lang.String, java.lang.String, org.dspace.content.Collection, java.lang.String)public String getLabel(MetadataValue metadataValue, String locale)
ChoiceAuthorityServicegetLabel in interface ChoiceAuthorityServicemetadataValue - metadata valuelocale - explicit localization key if availablepublic String getLabel(String fieldKey, String authKey, String locale)
ChoiceAuthorityServicegetLabel in interface ChoiceAuthorityServicefieldKey - single string identifying metadata fieldauthKey - authority keylocale - explicit localization key if availablepublic boolean isChoicesConfigured(String fieldKey)
ChoiceAuthorityServiceisChoicesConfigured in interface ChoiceAuthorityServicefieldKey - single string identifying metadata fieldpublic String getPresentation(String fieldKey)
ChoiceAuthorityServicegetPresentation in interface ChoiceAuthorityServicefieldKey - field keypublic boolean isClosed(String fieldKey)
ChoiceAuthorityServiceisClosed in interface ChoiceAuthorityServicefieldKey - single string identifying metadata fieldpublic List<String> getVariants(MetadataValue metadataValue)
ChoiceAuthorityServicegetVariants in interface ChoiceAuthorityServicemetadataValue - metadata valueCopyright © 2016 DuraSpace. All rights reserved.