Class Related

java.lang.Object
org.dspace.content.virtual.Related
All Implemented Interfaces:
VirtualMetadataConfiguration

public class Related extends Object implements VirtualMetadataConfiguration
A bean implementing the VirtualMetadataConfiguration interface 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 Details

    • Related

      public Related()
  • Method Details

    • 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:
      setUseForPlace in interface VirtualMetadataConfiguration
      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:
      getUseForPlace in interface VirtualMetadataConfiguration
      Returns:
      The useForPlace to be used by this bean
    • setPopulateWithNameVariant

      public void setPopulateWithNameVariant(boolean populateWithNameVariant)
      Description copied from interface: VirtualMetadataConfiguration
      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)
      Specified by:
      setPopulateWithNameVariant in interface VirtualMetadataConfiguration
      Parameters:
      populateWithNameVariant - The boolean value that the populateWithNameVariant property will be set to
    • getPopulateWithNameVariant

      public boolean getPopulateWithNameVariant()
      Description copied from interface: VirtualMetadataConfiguration
      Generic getter for the populateWithNameVariant property
      Specified by:
      getPopulateWithNameVariant in interface VirtualMetadataConfiguration
      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:
      getValues in interface VirtualMetadataConfiguration
      Parameters:
      context - The relevant DSpace context
      item - 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