Class AuthorityValue

java.lang.Object
org.dspace.authority.AuthorityValue
Direct Known Subclasses:
PersonAuthorityValue

public class AuthorityValue extends Object
Author:
Antoine Snyers (antoine at atmire.com), Kevin Van de Velde (kevin at atmire dot com), Ben Bosman (ben at atmire dot com), Mark Diggory (markd at atmire dot com)
  • Constructor Details

    • AuthorityValue

      public AuthorityValue()
    • AuthorityValue

      public AuthorityValue(org.apache.solr.common.SolrDocument document)
  • Method Details

    • getId

      public String getId()
    • getField

      public String getField()
    • getValue

      public String getValue()
    • setId

      public void setId(String id)
    • setField

      public void setField(String field)
    • setValue

      public void setValue(String value)
    • getCreationDate

      public Instant getCreationDate()
    • setCreationDate

      public void setCreationDate(Instant creationDate)
    • setCreationDate

      public void setCreationDate(String creationDate)
    • getLastModified

      public Instant getLastModified()
    • setLastModified

      public void setLastModified(String lastModified)
    • setLastModified

      public void setLastModified(Instant lastModified)
    • isDeleted

      public boolean isDeleted()
    • setDeleted

      public void setDeleted(boolean deleted)
    • updateLastModifiedDate

      protected void updateLastModifiedDate()
    • update

      public void update()
    • delete

      public void delete()
    • getSolrInputDocument

      public org.apache.solr.common.SolrInputDocument getSolrInputDocument()
      Generate a solr record from this instance
      Returns:
      SolrInputDocument
    • setValues

      public void setValues(org.apache.solr.common.SolrDocument document)
      Initialize this instance based on a solr record
      Parameters:
      document - SolrDocument
    • updateItem

      public void updateItem(Context context, Item currentItem, MetadataValue value) throws SQLException, AuthorizeException
      Replace an item's DCValue with this authority
      Parameters:
      context - context
      value - metadata value
      currentItem - item
      Throws:
      SQLException - if database error
      AuthorizeException - if authorization error
    • choiceSelectMap

      public Map<String,String> choiceSelectMap()
      Information that can be used the choice ui.
      Returns:
      map
    • stringToDate

      public static Instant stringToDate(String date)
      Convert a date string to internal form, trying several parsers.
      Parameters:
      date - serialized date to be converted.
      Returns:
      converted date, or null if no parser accepted the input.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • generateString

      public String generateString()
      Provides a string that will allow this AuthorityType to be recognized and provides information to create a new instance to be created using newInstance(String). See the implementation of AuthorityValueServiceImpl.generateRaw(java.lang.String, java.lang.String, java.lang.String) for more details.
      Returns:
      see AuthorityValueService.GENERATE
    • newInstance

      public AuthorityValue newInstance(String info)
      Makes an instance of the AuthorityValue with the given information.
      Parameters:
      info - string info
      Returns:
      AuthorityValue
    • getAuthorityType

      public String getAuthorityType()
      Get the type of authority which created this value.
      Returns:
      type name.
    • hasTheSameInformationAs

      public boolean hasTheSameInformationAs(Object o)
      The regular equals() only checks if both AuthorityValues describe the same authority. This method checks if the AuthorityValues have different information E.g. it is used to decide when lastModified should be updated.
      Parameters:
      o - object
      Returns:
      true or false