Package org.dspace.content.virtual
Class Concatenate
- java.lang.Object
-
- org.dspace.content.virtual.Concatenate
-
- All Implemented Interfaces:
VirtualMetadataConfiguration
public class Concatenate extends Object implements VirtualMetadataConfiguration
A bean implementing theVirtualMetadataConfigurationinterface to achieve the generation of Virtual metadata The Concatenate bean will take all the values of each metadata field configured in the list and it will join all of these together with the separator defined in this bean. This means that whichever entry this bean belongs to, that metadata field will have the value of the related item's metadata values joined together with this separator. Only one value will be returned
-
-
Constructor Summary
Constructors Constructor Description Concatenate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getFields()Generic getter for the fields propertybooleangetPopulateWithNameVariant()Generic getter for the populateWithNameVariant propertyStringgetSeparator()Generic getter for the seperatorbooleangetUseForPlace()Generic getter for the useForPlace propertyList<String>getValues(Context context, Item item)this method will retrieve the metadata values from the given item for all the metadata fields listed in the fields property and it'll concatenate all those values together with the separator specified in this classvoidsetFields(List<String> fields)Generic setter for the fields propertyvoidsetPopulateWithNameVariant(boolean populateWithNameVariant)Generic setter for the populateWithNameVariant This property defines whether the value should be retrieved from the left/rightward on the Relationship (true) or through the configuration and usual way (false)voidsetSeparator(String separator)Generic setter for the seperator propertyvoidsetUseForPlace(boolean useForPlace)Generic setter for the useForPlace property
-
-
-
Method Detail
-
getFields
public List<String> getFields()
Generic getter for the fields property- Returns:
- The list of fields to be used in this bean
-
setFields
public void setFields(List<String> fields)
Generic setter for the fields property- Parameters:
fields- the list of fields to which the fields property will be set to
-
getSeparator
public String getSeparator()
Generic getter for the seperator- Returns:
- the seperator to be used by this bean
-
setSeparator
public void setSeparator(String separator)
Generic setter for the seperator property- Parameters:
separator- The String seperator value to which this seperator value will be set to
-
setUseForPlace
public void setUseForPlace(boolean useForPlace)
Generic setter for the useForPlace property- Specified by:
setUseForPlacein interfaceVirtualMetadataConfiguration- Parameters:
useForPlace- The boolean value that the useForPlace property will be set to
-
getUseForPlace
public boolean getUseForPlace()
Generic getter for the useForPlace property- Specified by:
getUseForPlacein interfaceVirtualMetadataConfiguration- Returns:
- The useForPlace to be used by this bean
-
setPopulateWithNameVariant
public void setPopulateWithNameVariant(boolean populateWithNameVariant)
Description copied from interface:VirtualMetadataConfigurationGeneric setter for the populateWithNameVariant This property defines whether the value should be retrieved from the left/rightward on the Relationship (true) or through the configuration and usual way (false)- Specified by:
setPopulateWithNameVariantin interfaceVirtualMetadataConfiguration- Parameters:
populateWithNameVariant- The boolean value that the populateWithNameVariant property will be set to
-
getPopulateWithNameVariant
public boolean getPopulateWithNameVariant()
Description copied from interface:VirtualMetadataConfigurationGeneric getter for the populateWithNameVariant property- Specified by:
getPopulateWithNameVariantin interfaceVirtualMetadataConfiguration- Returns:
- The populatewithNameVariant to be used by this bean
-
getValues
public List<String> getValues(Context context, Item item)
this method will retrieve the metadata values from the given item for all the metadata fields listed in the fields property and it'll concatenate all those values together with the separator specified in this class- Specified by:
getValuesin interfaceVirtualMetadataConfiguration- Parameters:
context- The relevant DSpace contextitem- The item that will be used to either retrieve metadata values from- Returns:
- The String value for all of the retrieved metadatavalues combined with the separator
-
-