Linkable.API
Class Creation

java.lang.Object
  |
  +--Linkable.API.Creation

public class Creation
extends java.lang.Object

The Creation object represents a single work, in the abstract sense. It contains the work's title, urn, authors, publication date, urls if any are known, and its DOI, if known. The database key is the urn.


Field Summary
private  Author[] authors
           
private  java.lang.String date
           
static boolean DEBUG
           
private  java.util.Vector displayID
           
private  java.lang.String doi
           
private  boolean hasURN
           
 int iExtended
           
static java.lang.String ME
           
private  java.lang.String myURN
           
private  java.lang.String title
           
 
Constructor Summary
Creation()
          Constructor
Creation(java.lang.String docURN)
          Constructor
 
Method Summary
 void addAuthor(Author a)
          addAuthor - appends this Author object to the list of authors for this work.
protected static Creation doWork(org.w3c.dom.Node work)
          Reconstructs a Creation out of XML DOM tree with root .
 boolean equals(Creation c)
          returns true if the specified creation is consistent with this one.
 boolean extendUrn()
          returns true if this URN is synthetic and another title word could be appended to it for uniqueness
protected static java.util.Vector fetchURN(java.lang.String urn)
          fetchURN returns a vector of creations that might match this name
protected static java.util.Vector fetchURN(java.lang.String author, java.lang.String date, java.lang.String title)
          fetchURN - given an author, date (year), and title, return zero or more Creations from the database.
 Author[] getAuthors()
           
 java.lang.String getDate()
           
 java.lang.String getDoi()
           
 java.lang.String getFirstAuthorLastName()
           
 java.lang.String getTitle()
           
 java.lang.String[] getURLs()
          get URLs - returns a String[] array which contains all the currently known URLs for this work; initially it is the archive's display ID, if known.
 java.lang.String getURN()
          get URN - returns a URN, either synthetic of DOI, for this work
private  boolean merge(Creation c)
          Merge this creation with the given one.
static Creation reconstruct(java.lang.String doi, java.lang.String urn)
          Reconstructs a Creation object from XML data stored in files.
protected  void save(java.lang.String doi)
           
 void setAuthors(Author[] alist)
          sets the entire author list
 void setDate(java.lang.String s)
          defines the publication date for this Creation object
 void setDisplayID(java.lang.String url)
          adds a url to this work's display list
 void setDoi(java.lang.String d)
          sets the DOI for this work
 void setTitle(java.lang.String s)
          sets the title for this work
 void setUrn(java.lang.String u)
          sets the URN for this work
static java.lang.String synthesizeURN(java.lang.String author, java.lang.String date, java.lang.String title)
          synthesizeURN - this is THE single place in the entire system where document ID's are synthesized.
 java.lang.String toString()
          see toXML
 java.lang.String toXML(java.lang.String pad)
          returns DublinCore XML string for this creation - we don't know displayID? However, if this Creation corresponds to an archive item that is being analyzed, then we should know that one URL.
 java.lang.String toXML(java.lang.String pad, java.lang.String id)
          like toXML, but adds an "id" attribute to the element.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

ME

public static final java.lang.String ME

DEBUG

public static boolean DEBUG

myURN

private java.lang.String myURN

title

private java.lang.String title

authors

private Author[] authors

date

private java.lang.String date

hasURN

private boolean hasURN

displayID

private java.util.Vector displayID

doi

private java.lang.String doi

iExtended

public int iExtended
Constructor Detail

Creation

public Creation()
Constructor

Creation

public Creation(java.lang.String docURN)
Constructor
Parameters:
String - giving the document's URN
Method Detail

setDisplayID

public void setDisplayID(java.lang.String url)
adds a url to this work's display list
Parameters:
the - url, as a String http://

setDoi

public void setDoi(java.lang.String d)
sets the DOI for this work
Parameters:
the - DOI, as a String (without the "doi:" prefix)

setUrn

public void setUrn(java.lang.String u)
sets the URN for this work
Parameters:
the - URN, as a String (without the "urn:" prefix). The URN is currently author+year+title (see synthesizeURN)

setTitle

public void setTitle(java.lang.String s)
sets the title for this work
Parameters:
the - title, as a String

addAuthor

public void addAuthor(Author a)
addAuthor - appends this Author object to the list of authors for this work. Does not update the Author database.
Parameters:
the - Author to be added.

setAuthors

public void setAuthors(Author[] alist)
sets the entire author list
Parameters:
the - array of Author objects to be stored in this Creation object. This is assigned by reference, so it is possible to change the Author list elsewhere in the system, behind the Creation's back.

setDate

public void setDate(java.lang.String s)
defines the publication date for this Creation object
Parameters:
The - date, in yyyy-mm-dd format.

getURN

public java.lang.String getURN()
get URN - returns a URN, either synthetic of DOI, for this work

getTitle

public java.lang.String getTitle()

getDate

public java.lang.String getDate()

getAuthors

public Author[] getAuthors()

getFirstAuthorLastName

public java.lang.String getFirstAuthorLastName()

synthesizeURN

public static java.lang.String synthesizeURN(java.lang.String author,
                                             java.lang.String date,
                                             java.lang.String title)
synthesizeURN - this is THE single place in the entire system where document ID's are synthesized.
Parameters:
author - is the first author's last name
date - is the date in oams format: yyyy-mm-dd or just the year
title - is the String containing the complete title

getURLs

public java.lang.String[] getURLs()
get URLs - returns a String[] array which contains all the currently known URLs for this work; initially it is the archive's display ID, if known. Idea is to map this work's metadata to a URN; feed the URN to a name handler; get back a list of URLs; return that as the result of this routine.

getDoi

public java.lang.String getDoi()

equals

public boolean equals(Creation c)
returns true if the specified creation is consistent with this one. Missing fields are filled in as a side effect.
Parameters:
- - the Creation object to be matched returns boolean if the Creations were the same or consistent

extendUrn

public boolean extendUrn()
returns true if this URN is synthetic and another title word could be appended to it for uniqueness

reconstruct

public static Creation reconstruct(java.lang.String doi,
                                   java.lang.String urn)
Reconstructs a Creation object from XML data stored in files.
Parameters:
String - that is the "DOI" for the surrogate who knows about this Creation
int - that is 0 if the creation corresponds to the DOI itself, or i>0 for the i-th reference in the DOI Surrogate
Urn - that is requestiong this reconstruction (may be incomplete)

doWork

protected static Creation doWork(org.w3c.dom.Node work)
Reconstructs a Creation out of XML DOM tree with root .
Parameters:
The - root of the subtree.

toXML

public java.lang.String toXML(java.lang.String pad)
returns DublinCore XML string for this creation - we don't know displayID? However, if this Creation corresponds to an archive item that is being analyzed, then we should know that one URL. That should be passed as the display ID. If this Creation is for a Reference or a Citation, then it is proper to pass "" as the display ID. Also it would be proper to pass "" as the DOI if there is no surrogate The URN is used to look up URLs.
Parameters:
A - string containing zero or more blanks to be used as a pad

toXML

public java.lang.String toXML(java.lang.String pad,
                              java.lang.String id)
like toXML, but adds an "id" attribute to the element.
Parameters:
pad, - passed on to vanilla toXML
the - id, which could be a repository name and id

toString

public java.lang.String toString()
see toXML
Overrides:
toString in class java.lang.Object

save

protected void save(java.lang.String doi)

fetchURN

protected static java.util.Vector fetchURN(java.lang.String author,
                                           java.lang.String date,
                                           java.lang.String title)
fetchURN - given an author, date (year), and title, return zero or more Creations from the database. The routine is here because here is where the synthetic URN is defined, along with wildcard characters.
Parameters:
author - is the first author's last name
date - is the date in oams format: yyyy-mm-dd or just the year
title - is the String containing the complete title

fetchURN

protected static java.util.Vector fetchURN(java.lang.String urn)
fetchURN returns a vector of creations that might match this name
Parameters:
String - that is a synthetic URN

merge

private boolean merge(Creation c)
Merge this creation with the given one. Only the fields of the Creation objects are changed. The objects themselves do not change.