Package org.dspace.authority
Class AuthorityValue
java.lang.Object
org.dspace.authority.AuthorityValue
- Direct Known Subclasses:
PersonAuthorityValue
- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInformation that can be used the choice ui.voiddelete()Provides a string that will allow this AuthorityType to be recognized and provides information to create a new instance to be created usingnewInstance(String).Get the type of authority which created this value.getField()getId()org.apache.solr.common.SolrInputDocumentGenerate a solr record from this instancegetValue()booleanThe regular equals() only checks if both AuthorityValues describe the same authority.booleannewInstance(String info) Makes an instance of the AuthorityValue with the given information.voidsetCreationDate(String creationDate) voidsetCreationDate(Instant creationDate) voidsetDeleted(boolean deleted) voidvoidvoidsetLastModified(String lastModified) voidsetLastModified(Instant lastModified) voidvoidsetValues(org.apache.solr.common.SolrDocument document) Initialize this instance based on a solr recordstatic InstantstringToDate(String date) Convert a date string to internal form, trying several parsers.toString()voidupdate()voidupdateItem(Context context, Item currentItem, MetadataValue value) Replace an item's DCValue with this authorityprotected void
-
Constructor Details
-
AuthorityValue
public AuthorityValue() -
AuthorityValue
public AuthorityValue(org.apache.solr.common.SolrDocument document)
-
-
Method Details
-
getId
-
getField
-
getValue
-
setId
-
setField
-
setValue
-
getCreationDate
-
setCreationDate
-
setCreationDate
-
getLastModified
-
setLastModified
-
setLastModified
-
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- contextvalue- metadata valuecurrentItem- item- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
choiceSelectMap
Information that can be used the choice ui.- Returns:
- map
-
stringToDate
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
-
generateString
Provides a string that will allow this AuthorityType to be recognized and provides information to create a new instance to be created usingnewInstance(String). See the implementation ofAuthorityValueServiceImpl.generateRaw(java.lang.String, java.lang.String, java.lang.String)for more details.- Returns:
- see
AuthorityValueService.GENERATE
-
newInstance
Makes an instance of the AuthorityValue with the given information.- Parameters:
info- string info- Returns:
- AuthorityValue
-
getAuthorityType
Get the type of authority which created this value.- Returns:
- type name.
-
hasTheSameInformationAs
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
-