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
ConstructorsConstructorDescriptionMetadata()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 aMetadataParameterlist.Metadata(String label, String masterValue, List<MetadataParameter> params) Constructor with aMetadataParameterlist. -
Method Summary
Modifier and TypeMethodDescriptionbooleanfilterMetadata(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.static MetadatagetCombinedValue(String separator) intgetLabel()Getter for the fieldlabel.Getter for the fieldmasterValue.intGetter for the fieldnumber.intGetter for the fieldparams.getParamValue(String field) static StringgetPersonDisplayName(String aggregatedMetadata) Converts aggregated person/corporation metadata to just the displayable name.intgetType()Getter for the fieldtype.Getter for the fieldvalues.getValuesForOwner(String ownerIddoc) inthashCode()booleanhasParam.booleanbooleanisBlank()Checks whether any parameter values are set.booleanbooleanisGroup()isGroup.booleanbooleanisHasLabel.booleanbooleanbooleanbooleanpopulate(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.booleanpopulate(StructElement se, String ownerIddoc, List<StringPair> sortFields, Locale locale) voidsetAccessGranted(boolean accessGranted) voidsetCitationProcessorWrapper(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) voidsetParamValue(int valueIndex, int paramIndex, List<String> inValues, RelationshipMetadataContainer relatedMetadata, String paramLabel, String url, Map<String, String> options, String groupType, Locale locale) voidsetParamValue(int valueIndex, int paramIndex, List<String> inValues, String paramLabel, String url, Map<String, String> options, String groupType, Locale locale) setParamValue.voidsetParentMetadata(Metadata parentMetadata) setSeparator(String separator) setSingleString(boolean singleString) setSortField(String sortField) setTopstructOnly(boolean topstructOnly) setType(int type) toString()
-
Constructor Details
-
Metadata
-
Metadata
public Metadata()Default constructor.
-
Metadata
Constructor with a single metadata value.
-
Metadata
Constructor with a
MetadataParameterlist. -
Metadata
Constructor with a
MetadataParameterlist. -
Metadata
public Metadata(String ownerIddoc, String label, String masterValue, MetadataParameter param, String paramValue, Locale locale) Constructor for Metadata.
- Parameters:
ownerIddoc-label- aStringobject.masterValue- aStringobject.param- aMetadataParameterobject.paramValue- aStringobject.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
Stringobject.
-
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 ifownerIddocnull
-
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- aStringobject.- 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:
IndexUnreachableExceptionPresentationException
-
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- aStructElementobject.anchorSe- Optional anchorStructElementownerIddoc- IDDOC of the owner document (either docstruct or parent metadata)sortFields-searchTerms-truncateLength-locale- aLocaleobject.- 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
-
isAccessGranted
public boolean isAccessGranted()- Returns:
- the accessGranted
-
setAccessGranted
public void setAccessGranted(boolean accessGranted) - Parameters:
accessGranted- the accessGranted to set
-
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
-
forField
-