Package io.goobi.viewer.model.metadata
Class Metadata
java.lang.Object
io.goobi.viewer.model.metadata.Metadata
- All Implemented Interfaces:
Serializable
Metadata field configuration.
- See Also:
-
Constructor Summary
ConstructorDescriptionMetadata()
Default constructor.Metadata
(String ownerIddoc, String label, String masterValue, MetadataParameter param, String paramValue, Locale locale) Constructor for Metadata.Constructor with a single metadata value.Constructor with aMetadataParameter
list.Metadata
(String label, String masterValue, List<MetadataParameter> params) Constructor with aMetadataParameter
list. -
Method Summary
Modifier and TypeMethodDescriptionboolean
filterMetadata
(List<Metadata> metadataList, String language, String field) Returns a metadata list that contains the fields of the given metadata list minus any language-specific fields that do not match the given language.getCombinedValue
(String separator) int
getLabel()
Getter for the fieldlabel
.Getter for the fieldmasterValue
.int
Getter for the fieldnumber
.int
Getter for the fieldparams
.getParamValue
(String field) static String
getPersonDisplayName
(String aggregatedMetadata) Converts aggregated person/corporation metadata to just the displayable name.int
getType()
Getter for the fieldtype
.Getter for the fieldvalues
.getValuesForOwner
(String ownerIddoc) int
hashCode()
boolean
hasParam.boolean
isBlank()
Checks whether any parameter values are set.boolean
boolean
isGroup()
isGroup.boolean
boolean
isHasLabel.boolean
boolean
boolean
boolean
populate
(StructElement se, StructElement anchorSe, String ownerIddoc, List<StringPair> sortFields, Map<String, Set<String>> searchTerms, int truncateLength, Locale locale) Populates the parameters of the given metadata with values from the given StructElement.boolean
populate
(StructElement se, String ownerIddoc, List<StringPair> sortFields, Locale locale) void
setCitationProcessorWrapper
(CitationProcessorWrapper citationProcessorWrapper) setCitationTemplate
(String citationTemplate) setFilterQuery
(String filterQuery) setGroup
(boolean group) setHideIfOnlyMetadataField
(boolean hideIfOnlyMetadataField) setIndentation
(int indentation) setLabelField
(String labelField) setNumber
(int number) setOwnerDocstrctType
(String ownerDocstrctType) void
setParamValue
(int valueIndex, int paramIndex, List<String> inValues, RelationshipMetadataContainer relatedMetadata, String paramLabel, String url, Map<String, String> options, String groupType, Locale locale) void
setParamValue
(int valueIndex, int paramIndex, List<String> inValues, String paramLabel, String url, Map<String, String> options, String groupType, Locale locale) setParamValue.void
setParentMetadata
(Metadata parentMetadata) setSeparator
(String separator) setSingleString
(boolean singleString) setSortField
(String sortField) setTopstructOnly
(boolean topstructOnly) setType
(int type) toString()
-
Constructor Details
-
Metadata
public Metadata()Default constructor.
-
Metadata
Constructor with a single metadata value.
-
Metadata
Constructor with a
MetadataParameter
list. -
Metadata
Constructor with a
MetadataParameter
list. -
Metadata
public Metadata(String ownerIddoc, String label, String masterValue, MetadataParameter param, String paramValue, Locale locale) Constructor for Metadata.
- Parameters:
ownerIddoc
-label
- aString
object.masterValue
- aString
object.param
- aMetadataParameter
object.paramValue
- aString
object.locale
-
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
isHasLabel
public boolean isHasLabel()isHasLabel.
- Returns:
- a boolean.
-
getLabel
Getter for the field
label
.- Returns:
- the label
-
getMasterValue
Getter for the field
masterValue
.- Returns:
- a
String
object.
-
getType
public int getType()Getter for the field
type
.- Returns:
- the type
-
setType
- Parameters:
type
- the type to set- Returns:
- this
-
getSortFields
- Returns:
- List
-
getSortField
- Returns:
- the sortField
-
setSortField
- Parameters:
sortField
- the sortField to set- Returns:
- this
-
getValues
Getter for the field
values
.- Returns:
- the values
-
getValuesForOwner
- Parameters:
ownerIddoc
-- Returns:
- Sublist of all values that belong to
ownerIddoc
; all values ifownerIddoc
null
-
getFirstValue
- Returns:
- First
MetadataValue
-
setParamValue
public void setParamValue(int valueIndex, int paramIndex, List<String> inValues, String paramLabel, String url, Map<String, String> options, String groupType, Locale locale) setParamValue.
-
setParamValue
-
getParams
Getter for the field
params
.- Returns:
- the params
-
getParamFieldNames
- Returns:
- Configured index field names of parameters
-
hasParam
hasParam.
- Parameters:
paramName
- aString
object.- Returns:
- a boolean.
-
getParamCount
public int getParamCount()- Returns:
- Number of params
-
getParamValue
-
isBlank
public boolean isBlank()Checks whether any parameter values are set. 'empty' seems to be a reserved word in JSF, so use 'blank'.- Returns:
- true if all paramValues are empty or blank; false otherwise.
-
isBlank
- Parameters:
ownerIddoc
-- Returns:
- true if this metadata contains no non-blank values; false otherwise
-
populate
public boolean populate(StructElement se, String ownerIddoc, List<StringPair> sortFields, Locale locale) throws IndexUnreachableException, PresentationException - Parameters:
se
-ownerIddoc
-sortFields
-locale
-- Returns:
- a boolean.
- Throws:
IndexUnreachableException
PresentationException
-
populate
public boolean populate(StructElement se, StructElement anchorSe, String ownerIddoc, List<StringPair> sortFields, Map<String, Set<String>> searchTerms, int truncateLength, Locale locale) throws IndexUnreachableException, PresentationExceptionPopulates the parameters of the given metadata with values from the given StructElement.- Parameters:
se
- aStructElement
object.anchorSe
- Optional anchorStructElement
ownerIddoc
- IDDOC of the owner document (either docstruct or parent metadata)sortFields
-searchTerms
-truncateLength
-locale
- aLocale
object.- Returns:
- a boolean.
- Throws:
IndexUnreachableException
- if any.PresentationException
- if any.
-
getPersonDisplayName
Converts aggregated person/corporation metadata to just the displayable name. -
getNumber
public int getNumber()Getter for the field
number
.- Returns:
- a int.
-
setNumber
- Parameters:
number
- the number to set- Returns:
- this
-
isGroup
public boolean isGroup()isGroup.
- Returns:
- the group
-
setGroup
- Parameters:
group
- the group to set- Returns:
- this
-
isSingleString
public boolean isSingleString()- Returns:
- the singleString
-
setSingleString
- Parameters:
singleString
- the singleString to set- Returns:
- this
-
isHideIfOnlyMetadataField
public boolean isHideIfOnlyMetadataField()- Returns:
- the hideIfOnlyMetadataField
-
setHideIfOnlyMetadataField
- Parameters:
hideIfOnlyMetadataField
- the hideIfOnlyMetadataField to set- Returns:
- this
-
isTopstructOnly
public boolean isTopstructOnly()- Returns:
- the topstructOnly
-
setTopstructOnly
- Parameters:
topstructOnly
- the topstructOnly to set- Returns:
- this
-
getLabelField
- Returns:
- the labelField
-
setLabelField
- Parameters:
labelField
- the labelField to set- Returns:
- this
-
getSeparator
- Returns:
- the separator
-
setSeparator
- Parameters:
separator
- the separator to set- Returns:
- this
-
getOwnerDocstrctType
- Returns:
- the ownerDocstrctType
-
setOwnerDocstrctType
- Parameters:
ownerDocstrctType
- the ownerDocstrctType to set- Returns:
- this
-
setFilterQuery
-
getFilterQuery
-
getCitationTemplate
- Returns:
- the citationTemplate
-
setCitationTemplate
- Parameters:
citationTemplate
- the citationTemplate to set- Returns:
- this
-
getCitationProcessorWrapper
- Returns:
- the citationProcessorWrapper
-
setCitationProcessorWrapper
- Parameters:
citationProcessorWrapper
- the citationProcessorWrapper to set
-
getParentMetadata
- Returns:
- the parentMetadata
-
setParentMetadata
- Parameters:
parentMetadata
- the parentMetadata to set
-
isHasChildren
public boolean isHasChildren()- Returns:
- true if childMetadata not empty; false otherwise
-
getChildMetadata
- Returns:
- the childMetadata
-
getIndentation
public int getIndentation()- Returns:
- the indentation
-
setIndentation
- Parameters:
indentation
- the indentation to set- Returns:
- this
-
filterMetadata
public static List<Metadata> filterMetadata(List<Metadata> metadataList, String language, String field) Returns a metadata list that contains the fields of the given metadata list minus any language-specific fields that do not match the given language. -
toString
-
getCombinedValue
-