Package org.dspace.authority
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 Summary
Constructors Constructor Description AuthorityValue()AuthorityValue(org.apache.solr.common.SolrDocument document)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>choiceSelectMap()Information that can be used the choice uivoiddelete()StringgenerateString()Provides a string that will allow this AuthorityType to be recognized and provides information to create a new instance to be created usingnewInstance(String).StringgetAuthorityType()DategetCreationDate()List<org.joda.time.format.DateTimeFormatter>getDateFormatters()StringgetField()StringgetId()DategetLastModified()org.apache.solr.common.SolrInputDocumentgetSolrInputDocument()Generate a solr record from this instanceStringgetValue()booleanhasTheSameInformationAs(Object o)The regular equals() only checks if both AuthorityValues describe the same authority.booleanisDeleted()AuthorityValuenewInstance(String info)Makes an instance of the AuthorityValue with the given information.voidsetCreationDate(String creationDate)voidsetCreationDate(Date creationDate)voidsetDeleted(boolean deleted)voidsetField(String field)voidsetId(String id)voidsetLastModified(String lastModified)voidsetLastModified(Date lastModified)voidsetValue(String value)voidsetValues(org.apache.solr.common.SolrDocument document)Initialize this instance based on a solr recordDatestringToDate(String date)StringtoString()voidupdate()voidupdateItem(Context context, Item currentItem, MetadataValue value)Replace an item's DCValue with this authorityprotected voidupdateLastModifiedDate()
-
-
-
Method Detail
-
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 Date getCreationDate()
-
setCreationDate
public void setCreationDate(Date creationDate)
-
setCreationDate
public void setCreationDate(String creationDate)
-
getLastModified
public Date getLastModified()
-
setLastModified
public void setLastModified(String lastModified)
-
setLastModified
public void setLastModified(Date 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- contextvalue- metadata valuecurrentItem- item- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
choiceSelectMap
public Map<String,String> choiceSelectMap()
Information that can be used the choice ui- Returns:
- map
-
getDateFormatters
public List<org.joda.time.format.DateTimeFormatter> getDateFormatters()
-
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 usingnewInstance(String). See the implementation ofAuthorityValueServiceImpl.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()
-
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
-
-