Package org.dspace.content.virtual
Class Related
- java.lang.Object
-
- org.dspace.content.virtual.Related
-
- All Implemented Interfaces:
VirtualMetadataConfiguration
public class Related extends Object implements VirtualMetadataConfiguration
A bean implementing theVirtualMetadataConfigurationinterface to achieve the generation of Virtual metadata by traversing the path of relation specified in the config for this bean The Related bean will find the relationshiptype defined in the relationshipTypeString property on the current item and it'll use the related item from that relationship to pass it along to the virtualMetadataConfiguration property which in turn refers to another VirtualBean instance and it continues the chain until it reaches either a Concatenate or Collected bean to retrieve the values. It will then return that value through the chain again and it'll fill the values into the virtual metadata fields that are defined in the map for the first Related bean.
-
-
Constructor Summary
Constructors Constructor Description Related()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetPlace()Generic getter for the place property of this classbooleangetPopulateWithNameVariant()Generic getter for the populateWithNameVariant propertyStringgetRelationshipTypeString()Generic getter for the relationshipTypeString property of this classbooleangetUseForPlace()Generic getter for the useForPlace propertyList<String>getValues(Context context, Item item)This method will find the correct Relationship from the given item to retrieve the other item from it and pass this along to the next VirtualBean that's stored in this class.VirtualMetadataConfigurationgetVirtualMetadataConfiguration()Generic getter for the virtualMetadataConfiguration property of this classvoidsetPlace(Integer place)Generic setter for the place property of this classvoidsetPopulateWithNameVariant(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)voidsetRelationshipTypeString(String relationshipTypeString)Generic setter for the relationshipTypeString property of this classvoidsetUseForPlace(boolean useForPlace)Generic setter for the useForPlace propertyvoidsetVirtualMetadataConfiguration(VirtualMetadataConfiguration virtualMetadataConfiguration)Generic setter for the virtualMetadataConfiguration property of this class
-
-
-
Method Detail
-
getRelationshipTypeString
public String getRelationshipTypeString()
Generic getter for the relationshipTypeString property of this class- Returns:
- The relationshipTypeString property
-
setRelationshipTypeString
public void setRelationshipTypeString(String relationshipTypeString)
Generic setter for the relationshipTypeString property of this class- Parameters:
relationshipTypeString- The String to which the relationshipTypeString will be set to
-
getPlace
public Integer getPlace()
Generic getter for the place property of this class- Returns:
- The place property
-
setPlace
public void setPlace(Integer place)
Generic setter for the place property of this class- Parameters:
place- The Integer to which the place property will be set to
-
getVirtualMetadataConfiguration
public VirtualMetadataConfiguration getVirtualMetadataConfiguration()
Generic getter for the virtualMetadataConfiguration property of this class- Returns:
- The virtualMetadataConfiguration property
-
setVirtualMetadataConfiguration
public void setVirtualMetadataConfiguration(VirtualMetadataConfiguration virtualMetadataConfiguration)
Generic setter for the virtualMetadataConfiguration property of this class- Parameters:
virtualMetadataConfiguration- The VirtualBean to which the virtualMetadataConfiguration property 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) throws SQLException
This method will find the correct Relationship from the given item to retrieve the other item from it and pass this along to the next VirtualBean that's stored in this class.- Specified by:
getValuesin interfaceVirtualMetadataConfiguration- Parameters:
context- The relevant DSpace contextitem- The item that will be used to find the related item through its relationships- Returns:
- The String value of the metadata fields concatenated with a separator as defined in the deepest Concatenated bean in the chain Will return an empty list if no relationships are found
- Throws:
SQLException- If something goes wrong
-
-