org.sciplore.resources
Class Document

java.lang.Object
  extended by org.sciplore.resources.Resource
      extended by org.sciplore.resources.Document

@Entity
public class Document
extends Resource

Resource class for documents.

Author:
Mario Lipinski <lipinski@sciplore.org>
See Also:
Resource

Constructor Summary
Document()
          Generate an empty Document.
Document(Integer id)
          Generate a Document with an identifier.
Document(Integer id, String title)
          Generate a Document with identifier and title.
Document(String title)
          Generate a Document with title.
 
Method Summary
 void addAlert(Alert a)
          Add an Alert to the Document.
 void addChild(Document c)
          Add a child to the Document.
 void addCitation(Citation c)
          Add a Citation from this document.
 void addKeyword(Keyword k)
          Add a Keyword to the document.
 void addPerson(DocumentPerson p)
          Add a person to the document using a DocumentPerson object.
 void addPerson(Person p)
          Add a person to the document using a Person object to construct the DocumentPerson.
 void addRcvdCitation(Citation c)
          Add a received Citation of this Document.
 void addXref(DocumentXref x)
          Add a cross reference to the Document.
static String generateCleanTitle(String title)
          Cleans a title by removing all characters apart from A-Z, a-z and 0-9 and makes it all lower case so the title can be compared more tolerantly.
 String getAbstract()
          Returns the abstract
 Set<Alert> getAlerts()
          Returns the Alerts
 Set<Document> getChildren()
          Returns the children.
 Set<Citation> getCitations()
          Returns the Citations by this Document.
 String getCleantitle()
          Returns the clean title.
static Document getDocument(Document d)
          Returns a Document from the database for a Document object.
static Document getDocument(Integer id)
          Returns the Document for an identifier.
static Document getDocument(String title)
          Returns a Document for a title.
static Document getDocumentBySourceId(String source, String id)
          Returns a document for a source id.
static List<Document> getDocuments()
          Returns a list of all Documents.
static List<Document> getDocuments(Short max)
          Returns a list of all Documents with a limiter of the result number as parameter.
static List<Document> getDocuments(String search)
          Returns a list of Documents for a search string.
static List<Document> getDocuments(String search, Short start, Short maxresults)
          Returns a list of Document for a search string.
 String getDoi()
          Returns the digital object identifier.
 Short getEdition()
          Returns the edition.
 Set<Feedback> getFeedbacks()
          Returns the feedbacks.
 Set<DocumentFulltext> getFulltexts()
          Returns the fulltext elements.
 Set<FulltextUrl> getFulltextUrls()
          Returns the fulltext URLs.
 String getHash()
          Returns the hash.
 Integer getId()
          Returns the identifier.
 Institution getInstitution()
          Returns the institution.
 String getIsbn()
          Returns the ISBN.
 String getIssn()
          Returns the ISSN.
 Set<Keyword> getKeywords()
          Returns the keywords.
 String getLanguage()
          Returns the langugae.
 String getNumber()
          Returns the number of the collection this document was published in.
 String getPages()
          Returns the pages this document was published at in the collection.
 Document getParent()
          Returns the parent document.
 Set<DocumentPerson> getPersons()
          Returns the persons.
 Short getPublishedDay()
          Returns the day of publication.
 String getPublishedMonth()
          Returns the month of publication.
 String getPublishedPlace()
          Returns the place of publication.
 Short getPublishedYear()
          Returns the year of publication.
 String getPublisher()
          Returns the publisher.
 Set<Citation> getRcvdCitations()
          Returns the citations this document received.
 String getSeries()
          Returns the series of the collection this document was published in.
 String getTitle()
          Returns the title.
 String getType()
          Returns the type.
 Short getValid()
          Returns information about the validity of the record.
 Venue getVenue()
          Returns the venue.
 String getVolume()
          Returns the volume of the collection this document was published in.
 StringBuffer getXML()
          Some XML stuff for the web service.
 Set<DocumentXref> getXrefs()
          Returns the cross references.
 void setAbstract(String documentAbstract)
          Sets the abstract.
 void setAlerts(Set<Alert> alerts)
          Sets the alerts.
 void setChildren(Set<Document> children)
          Sets the children.
 void setCitations(Set<Citation> citations)
          Sets the citations by this document.
 void setCleantitle(String cleantitle)
          Sets the clean title.
 void setDoi(String doi)
          Sets the digital object identifier.
 void setEdition(Short edition)
          Sets the edition of the collection this document was published in.
 void setFeedbacks(Set<Feedback> feedbacks)
          Sets the feedbacks.
 void setFulltexts(Set<DocumentFulltext> fulltexts)
          Sets the fulltexts.
 void setFulltextUrls(Set<FulltextUrl> fulltextUrls)
          Sets the fulltext URLs.
 void setHash(String hash)
          Sets the hash.
 void setId(Integer id)
          Sets the identifier.
 void setInstitution(Institution institution)
          Sets the institution.
 void setIsbn(String isbn)
          Sets the ISBN.
 void setIssn(String issn)
          Sets the ISSN.
 void setKeywords(Set<Keyword> keywords)
          Sets the keywords.
 void setLanguage(String language)
          Sets the language.
 void setNumber(String number)
          Sets the number of the collection this document was published in.
 void setPages(String pages)
          Sets the pages where this document has been published in the collection.
 void setParent(Document parent)
          Sets the parent document.
 void setPersons(Set<DocumentPerson> persons)
          Sets the persons.
 void setPublishedDay(Short publishedDay)
          Sets the day of publication.
 void setPublishedMonth(String publishedMonth)
          Sets the month of publication.
 void setPublishedPlace(String publishedPlace)
          Sets the place of publication.
 void setPublishedYear(Short publishedYear)
          Sets the year of publication.
 void setPublisher(String publisher)
          Sets the publisher.
 void setRcvdCitations(Set<Citation> rcvdCitations)
          Sets the citations received by this document.
 void setSeries(String series)
          Sets the series of the collection where this document has been published.
 void setTitle(String title)
          Sets the title.
 void setType(String type)
          Sets the type.
 void setValid(Short valid)
          Sets information about the validity of the record.
 void setVenue(Venue venue)
          Sets the venue.
 void setVolume(String volume)
          Sets the volume of the collection this document has been published in.
 void setXrefs(Set<DocumentXref> xrefs)
          Sets the cross references.
static Document sync(Document d)
          Synchronizes a Document object with a record from the database.
 String toString()
          Returns a string representation of this document.
 
Methods inherited from class org.sciplore.resources.Resource
save
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Document

public Document()
Generate an empty Document.


Document

public Document(Integer id,
                String title)
Generate a Document with identifier and title.

Parameters:
id - the identifier
title - the title

Document

public Document(Integer id)
Generate a Document with an identifier.

Parameters:
id - the identifier

Document

public Document(String title)
Generate a Document with title.

Parameters:
title - the title
Method Detail

generateCleanTitle

public static String generateCleanTitle(String title)
Cleans a title by removing all characters apart from A-Z, a-z and 0-9 and makes it all lower case so the title can be compared more tolerantly. The cleaned title should always be used for title comparison instead of the real title.

Parameters:
title - the title
Returns:
the cleaned title

getDocument

public static Document getDocument(Document d)
Returns a Document from the database for a Document object.

Parameters:
d - the Document
Returns:
the Document object from the database or null if not found

getDocument

public static Document getDocument(Integer id)
Returns the Document for an identifier.

Parameters:
id - the identifier
Returns:
the Document from the database or null if not found

getDocument

public static Document getDocument(String title)
Returns a Document for a title. The cleantitle attribute is used for matching.

Parameters:
title - the title
Returns:
the Document from the database or null if not found

getDocumentBySourceId

public static Document getDocumentBySourceId(String source,
                                             String id)
Returns a document for a source id.

Parameters:
source - the source
id - the sources id
Returns:
the Document or null if not found

getDocuments

public static List<Document> getDocuments()
Returns a list of all Documents.

Returns:
the list of Documents

getDocuments

public static List<Document> getDocuments(Short max)
Returns a list of all Documents with a limiter of the result number as parameter.

Parameters:
max - maximum number of documents returned
Returns:
the list of Documents

getDocuments

public static List<Document> getDocuments(String search)
Returns a list of Documents for a search string. The current implementation only matches the beginning of the (clean)title.

Parameters:
search - the search string
Returns:
the list of Documents

getDocuments

public static List<Document> getDocuments(String search,
                                          Short start,
                                          Short maxresults)
Returns a list of Document for a search string. Only maxresults matches are returned starting at start. This function is intended to be used for pagination. The current implementation only matches the beginning of the (clean)title.

Parameters:
search - the search string
start - the starting offset
maxresults - the number of results to return at most
Returns:
the list of Documents

sync

public static Document sync(Document d)
Synchronizes a Document object with a record from the database. If the object does not exist, it is added to the database. In any case related objects are synchronized as well.

Parameters:
d - the document
Returns:
the synchronized Document which stored in the database

addAlert

public void addAlert(Alert a)
Add an Alert to the Document.

Parameters:
a - the alert
See Also:
Alert

addChild

public void addChild(Document c)
Add a child to the Document.

Parameters:
c - the child

addCitation

public void addCitation(Citation c)
Add a Citation from this document.

Parameters:
c - the Citation
See Also:
Citation

addKeyword

public void addKeyword(Keyword k)
Add a Keyword to the document.

Parameters:
k - the Keyword
See Also:
Keyword

addPerson

public void addPerson(DocumentPerson p)
Add a person to the document using a DocumentPerson object.

Parameters:
p - the DocumentPerson object
See Also:
DocumentPerson

addPerson

public void addPerson(Person p)
Add a person to the document using a Person object to construct the DocumentPerson.

Parameters:
p - the Person object
See Also:
Person, DocumentPerson

addRcvdCitation

public void addRcvdCitation(Citation c)
Add a received Citation of this Document.

Parameters:
c - the received Citation
See Also:
Citation

addXref

public void addXref(DocumentXref x)
Add a cross reference to the Document.

Parameters:
x - the cross reference
See Also:
DocumentXref

getAbstract

public String getAbstract()
Returns the abstract

Returns:
the abstract

getAlerts

public Set<Alert> getAlerts()
Returns the Alerts

Returns:
the Alerts
See Also:
Alert

getChildren

public Set<Document> getChildren()
Returns the children.

Returns:
the children

getCitations

public Set<Citation> getCitations()
Returns the Citations by this Document.

Returns:
the Citations
See Also:
Citation

getCleantitle

public String getCleantitle()
Returns the clean title.

Returns:
the cleantitle

getDoi

public String getDoi()
Returns the digital object identifier.

Returns:
the digital object identifier

getEdition

public Short getEdition()
Returns the edition.

Returns:
the edition

getFeedbacks

public Set<Feedback> getFeedbacks()
Returns the feedbacks.

Returns:
the feedbacks
See Also:
Feedback

getFulltexts

public Set<DocumentFulltext> getFulltexts()
Returns the fulltext elements.

Returns:
the fulltext elements
See Also:
DocumentFulltext

getFulltextUrls

public Set<FulltextUrl> getFulltextUrls()
Returns the fulltext URLs.

Returns:
the fulltext URLs
See Also:
FulltextUrl

getHash

public String getHash()
Returns the hash.

Returns:
the hash

getId

public Integer getId()
Returns the identifier.

Returns:
the identifier

getInstitution

public Institution getInstitution()
Returns the institution.

Returns:
the institution
See Also:
Institution

getIsbn

public String getIsbn()
Returns the ISBN.

Returns:
the ISBN

getIssn

public String getIssn()
Returns the ISSN.

Returns:
the ISSN

getKeywords

public Set<Keyword> getKeywords()
Returns the keywords.

Returns:
the keywords

getLanguage

public String getLanguage()
Returns the langugae.

Returns:
the language

getNumber

public String getNumber()
Returns the number of the collection this document was published in.

Returns:
the number of the collection

getPages

public String getPages()
Returns the pages this document was published at in the collection.

Returns:
the pages

getParent

public Document getParent()
Returns the parent document.

Returns:
the parent document

getPersons

public Set<DocumentPerson> getPersons()
Returns the persons.

Returns:
the persons
See Also:
DocumentPerson

getPublishedDay

public Short getPublishedDay()
Returns the day of publication.

Returns:
the day of publication

getPublishedMonth

public String getPublishedMonth()
Returns the month of publication.

Returns:
the month of publication

getPublishedPlace

public String getPublishedPlace()
Returns the place of publication.

Returns:
the place of publication

getPublishedYear

public Short getPublishedYear()
Returns the year of publication.

Returns:
the year of publication

getPublisher

public String getPublisher()
Returns the publisher.

Returns:
the publisher

getRcvdCitations

public Set<Citation> getRcvdCitations()
Returns the citations this document received.

Returns:
the received citation.
See Also:
Citation

getSeries

public String getSeries()
Returns the series of the collection this document was published in.

Returns:
the series of the collection

getTitle

public String getTitle()
Returns the title.

Returns:
the title

getType

public String getType()
Returns the type. The type usually is one of the following:

Returns:
the type

getValid

public Short getValid()
Returns information about the validity of the record.

Returns:
the validity

getVenue

public Venue getVenue()
Returns the venue.

Returns:
the venue
See Also:
Venue

getVolume

public String getVolume()
Returns the volume of the collection this document was published in.

Returns:
the volume of the collection

getXML

public StringBuffer getXML()
                    throws JAXBException
Some XML stuff for the web service. TODO Christoph

Returns:
???
Throws:
JAXBException

getXrefs

public Set<DocumentXref> getXrefs()
Returns the cross references.

Returns:
the cross references
See Also:
DocumentXref

setAbstract

public void setAbstract(String documentAbstract)
Sets the abstract.

Parameters:
documentAbstract - the abstract

setAlerts

public void setAlerts(Set<Alert> alerts)
Sets the alerts.

Parameters:
alerts - the alerts
See Also:
Alert

setChildren

public void setChildren(Set<Document> children)
Sets the children.

Parameters:
children - the children

setCitations

public void setCitations(Set<Citation> citations)
Sets the citations by this document.

Parameters:
citations - the citations by this document
See Also:
Citation

setCleantitle

public void setCleantitle(String cleantitle)
Sets the clean title.

Parameters:
cleantitle - the cleantitle

setDoi

public void setDoi(String doi)
Sets the digital object identifier.

Parameters:
doi - the digital object identifier

setEdition

public void setEdition(Short edition)
Sets the edition of the collection this document was published in.

Parameters:
edition - the edition of the collection

setFeedbacks

public void setFeedbacks(Set<Feedback> feedbacks)
Sets the feedbacks.

Parameters:
feedbacks - the feedbacks
See Also:
Feedback

setFulltexts

public void setFulltexts(Set<DocumentFulltext> fulltexts)
Sets the fulltexts.

Parameters:
fulltexts - the fulltexts
See Also:
DocumentFulltext

setFulltextUrls

public void setFulltextUrls(Set<FulltextUrl> fulltextUrls)
Sets the fulltext URLs.

Parameters:
fulltextUrls - the fulltext URLs
See Also:
FulltextUrl

setHash

public void setHash(String hash)
Sets the hash.

Parameters:
hash - the hash

setId

public void setId(Integer id)
Sets the identifier.

Parameters:
id - the identifier

setInstitution

public void setInstitution(Institution institution)
Sets the institution.

Parameters:
institution - the institution
See Also:
Institution

setIsbn

public void setIsbn(String isbn)
Sets the ISBN.

Parameters:
isbn - the isbn

setIssn

public void setIssn(String issn)
Sets the ISSN.

Parameters:
issn - the issn

setKeywords

public void setKeywords(Set<Keyword> keywords)
Sets the keywords.

Parameters:
keywords - the keywords
See Also:
Keyword

setLanguage

public void setLanguage(String language)
Sets the language.

Parameters:
language - the language

setNumber

public void setNumber(String number)
Sets the number of the collection this document was published in.

Parameters:
number - the number of the collection

setPages

public void setPages(String pages)
Sets the pages where this document has been published in the collection.

Parameters:
pages - the pages in the collection

setParent

public void setParent(Document parent)
Sets the parent document.

Parameters:
parent - the parent document

setPersons

public void setPersons(Set<DocumentPerson> persons)
Sets the persons.

Parameters:
persons - the persons
See Also:
DocumentPerson

setPublishedDay

public void setPublishedDay(Short publishedDay)
Sets the day of publication.

Parameters:
publishedDay - the day of publication

setPublishedMonth

public void setPublishedMonth(String publishedMonth)
Sets the month of publication.

Parameters:
publishedMonth - the month of publication

setPublishedPlace

public void setPublishedPlace(String publishedPlace)
Sets the place of publication.

Parameters:
publishedPlace - the place of publication

setPublishedYear

public void setPublishedYear(Short publishedYear)
Sets the year of publication.

Parameters:
publishedYear - the year of publication

setPublisher

public void setPublisher(String publisher)
Sets the publisher.

Parameters:
publisher - the publisher

setRcvdCitations

public void setRcvdCitations(Set<Citation> rcvdCitations)
Sets the citations received by this document.

Parameters:
rcvdCitations - the received citations
See Also:
Citation

setSeries

public void setSeries(String series)
Sets the series of the collection where this document has been published.

Parameters:
series - the series of the collection

setTitle

public void setTitle(String title)
Sets the title. This also updates the clean title.

Parameters:
title - the title

setType

public void setType(String type)
Sets the type. The type usually is one of the following:

Parameters:
type - the type

setValid

public void setValid(Short valid)
Sets information about the validity of the record.

Parameters:
valid - the validity

setVenue

public void setVenue(Venue venue)
Sets the venue.

Parameters:
venue - the venue
See Also:
Venue

setVolume

public void setVolume(String volume)
Sets the volume of the collection this document has been published in.

Parameters:
volume - the volume of the collection

setXrefs

public void setXrefs(Set<DocumentXref> xrefs)
Sets the cross references.

Parameters:
xrefs - the cross references.
See Also:
DocumentXref

toString

public String toString()
Returns a string representation of this document. Currently this is only the title.

Overrides:
toString in class Object
Returns:
string representation of this document