public class JSTORFetcher extends java.lang.Object implements EntryFetcher
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
COOKIE_CITATIONS
Cookie key for citations to be fetched
|
protected static java.lang.String |
COOKIE_TICKET
Cookie key for Jstor ticket (authentication)
|
protected static int |
MAX_CITATIONS
cookies can't save more than 200 citations
|
protected static java.lang.String |
URL_BIBTEX
location where to obtain the citations cookie
|
protected static java.lang.String |
URL_TICKET
location where the ticket is obtained
|
| Constructor and Description |
|---|
JSTORFetcher() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Collection<BibtexEntry> |
getBibtexEntries(java.lang.String ticket,
java.lang.String citations)
Given a ticket an a list of citations, retrieve BibtexEntries from JStor
|
protected java.lang.String |
getCitations(java.lang.String ticket,
java.lang.String query)
requires a valid JStor Ticket ID
|
static java.lang.String |
getCookie(java.lang.String name,
java.net.URLConnection conn)
evaluates the 'Set-Cookie'-Header of a HTTP response
|
java.lang.String |
getHelpPage()
Get the name of the help page for this activeFetcher.
|
java.net.URL |
getIcon()
Get the appropriate icon URL for this activeFetcher.
|
java.lang.String |
getKeyName()
Get the name of the key binding for this activeFetcher, if any.
|
javax.swing.JPanel |
getOptionsPanel()
If this activeFetcher requires additional options, a panel for setting up these
should be returned in a JPanel by this method.
|
java.lang.String |
getTitle()
The title for this activeFetcher, displayed in the menu and in the side pane.
|
protected java.lang.String |
openTicket() |
boolean |
processQuery(java.lang.String query,
ImportInspector dialog,
OutputPrinter status)
Handle a query entered by the user.
|
void |
stopFetching()
This method is called by the dialog when the user has cancelled or
signalled a stop.
|
protected static int MAX_CITATIONS
protected static final java.lang.String COOKIE_TICKET
protected static final java.lang.String URL_TICKET
protected static final java.lang.String COOKIE_CITATIONS
protected static final java.lang.String URL_BIBTEX
public java.lang.String getHelpPage()
EntryFetchergetHelpPage in interface EntryFetcherpublic java.net.URL getIcon()
EntryFetchergetIcon in interface EntryFetcherpublic java.lang.String getKeyName()
EntryFetchergetKeyName in interface EntryFetcherpublic javax.swing.JPanel getOptionsPanel()
EntryFetchergetOptionsPanel in interface EntryFetcherpublic java.lang.String getTitle()
EntryFetchergetTitle in interface EntryFetcherpublic void stopFetching()
ImportInspectionDialog.CallBackstopFetching in interface ImportInspectionDialog.CallBackpublic boolean processQuery(java.lang.String query,
ImportInspector dialog,
OutputPrinter status)
EntryFetcherprocessQuery in interface EntryFetcherquery - The query text.dialog - The dialog to add imported entries to.status - An OutputPrinter passed to the activeFetcher for reporting about the
status of the fetching.protected java.util.Collection<BibtexEntry> getBibtexEntries(java.lang.String ticket, java.lang.String citations) throws java.io.IOException
ticket - A valid ticket as returned by openTicket()citations - A list of citations as returned by getCitations()java.io.IOException - Most probably related to a problem connecting to JStor.protected java.lang.String openTicket()
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String getCitations(java.lang.String ticket,
java.lang.String query)
throws java.io.IOException
query - The search term to query JStor for.ticket - JStor ticketjava.io.IOExceptionpublic static java.lang.String getCookie(java.lang.String name,
java.net.URLConnection conn)
throws java.io.IOException
name - key of a cookie valueconn - URLConnectionjava.io.IOException