Package org.dspace.content.authority
Class MetadataAuthorityServiceImpl
java.lang.Object
org.dspace.content.authority.MetadataAuthorityServiceImpl
- All Implemented Interfaces:
MetadataAuthorityService
Broker for metadata authority settings configured for each metadata field.
Configuration keys, per metadata field (e.g. "dc.contributor.author")
# is field authority controlled (i.e. store authority, confidence values)?
authority.controlled.<FIELD> = true
# is field required to have an authority value, or may it be empty?
# default is false.
authority.required.<FIELD> = true | false
# default value of minimum confidence level for ALL fields - must be
# symbolic confidence level, see org.dspace.content.authority.Choices
authority.minconfidence = uncertain
# minimum confidence level for this field
authority.minconfidence.SCHEMA.ELEMENT.QUALIFIER = SYMBOL
e.g.
authority.minconfidence.dc.contributor.author = accepted
NOTE: There is *expected* to be a "choices" (see ChoiceAuthorityManager)
configuration for each authority-controlled field.- Author:
- Larry Stone
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConfigurationServiceprotected intfallback default value unless authority.minconfidence = X is configured.protected MetadataFieldServicemap of field key to answer of which is the min acceptable confidence value for a field with authority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method has been created to have a way of clearing the cache kept inside the serviceReturn the list of metadata field with authority control.intgetMinConfidence(MetadataField metadataField) Give the minimal level of confidence required to consider valid an authority value for the given metadata.voidinit()booleanisAuthorityControlled(String fieldKey) Predicate - is field authority-controlled?booleanisAuthorityControlled(MetadataField metadataField) Predicate - is field authority-controlled?booleanisAuthorityRequired(String fieldKey) Predicate - is authority value required for field?booleanisAuthorityRequired(MetadataField metadataField) Predicate - is authority value required for field?makeFieldKey(String schema, String element, String qualifier) Construct a single key from the tuple of schema/element/qualifier that describes a metadata field.makeFieldKey(MetadataField metadataField) Construct a single key from the tuple of schema/element/qualifier that describes a metadata field.
-
Field Details
-
metadataFieldService
-
configurationService
-
controlled
-
isAuthorityRequired
-
minConfidence
map of field key to answer of which is the min acceptable confidence value for a field with authority -
defaultMinConfidence
protected int defaultMinConfidencefallback default value unless authority.minconfidence = X is configured.
-
-
Constructor Details
-
MetadataAuthorityServiceImpl
protected MetadataAuthorityServiceImpl()
-
-
Method Details
-
init
public void init() -
isAuthorityControlled
Description copied from interface:MetadataAuthorityServicePredicate - is field authority-controlled?- Specified by:
isAuthorityControlledin interfaceMetadataAuthorityService- Parameters:
metadataField- metadata field- Returns:
- true/false
-
isAuthorityControlled
Description copied from interface:MetadataAuthorityServicePredicate - is field authority-controlled?- Specified by:
isAuthorityControlledin interfaceMetadataAuthorityService- Parameters:
fieldKey- field key- Returns:
- true/false
-
isAuthorityRequired
Description copied from interface:MetadataAuthorityServicePredicate - is authority value required for field?- Specified by:
isAuthorityRequiredin interfaceMetadataAuthorityService- Parameters:
metadataField- metadata field- Returns:
- true/false
-
isAuthorityRequired
Description copied from interface:MetadataAuthorityServicePredicate - is authority value required for field?- Specified by:
isAuthorityRequiredin interfaceMetadataAuthorityService- Parameters:
fieldKey- field key- Returns:
- true/false
-
makeFieldKey
Description copied from interface:MetadataAuthorityServiceConstruct a single key from the tuple of schema/element/qualifier that describes a metadata field. Punt to the function we use for submission UI input forms, for now.- Specified by:
makeFieldKeyin interfaceMetadataAuthorityService- Parameters:
metadataField- metadata field- Returns:
- field key
-
makeFieldKey
Description copied from interface:MetadataAuthorityServiceConstruct a single key from the tuple of schema/element/qualifier that describes a metadata field. Punt to the function we use for submission UI input forms, for now.- Specified by:
makeFieldKeyin interfaceMetadataAuthorityService- Parameters:
schema- schemaelement- elementqualifier- qualifier- Returns:
- field key
-
getMinConfidence
Give the minimal level of confidence required to consider valid an authority value for the given metadata.- Specified by:
getMinConfidencein interfaceMetadataAuthorityService- Parameters:
metadataField- metadata field- Returns:
- the minimal valid level of confidence for the given metadata
-
getAuthorityMetadata
Description copied from interface:MetadataAuthorityServiceReturn the list of metadata field with authority control. The strings are in the formschema.element[.qualifier]- Specified by:
getAuthorityMetadatain interfaceMetadataAuthorityService- Returns:
- the list of metadata field with authority control
-
clearCache
public void clearCache()Description copied from interface:MetadataAuthorityServiceThis method has been created to have a way of clearing the cache kept inside the service- Specified by:
clearCachein interfaceMetadataAuthorityService
-