|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface BibRefQuery
An interface defining functionality of a BibRefCollection (which is a main entry point to the queryied bibliographic repositories).
A BibRefQuery represents a collection ofBibliographic
references, and can be used for refining the collection by asking queries,
and/or to retrive the contents of the collection.
The implementations are advised to used the following constructor:
public NameOfAnImplementation (String[] args, Hashtable props) {...}
where both args and props contain implementation specific
parameters and properties. However, some properties are more probable to be
used - the suggested names for them are defined either in this interface or
in the "sister" interface BibRefSupport.
BibRef| Field Summary | |
|---|---|
static java.lang.String |
PROP_CRITERIONS
A property name ("criterions") specifying a list of searching and ordering criteria names. |
static java.lang.String |
PROP_EXCLUDED_ATTRS
A property name ("excluded") specifyies a list of attribute names. |
| Method Summary | |
|---|---|
void |
connect()
Make a connection to a repository, or/and make initialization steps needed for further communication. |
void |
connect(byte[] collectionId)
Make a connection to a repository, or/and make initialization steps needed for further communication, and make the collection described by 'collectionId' the current collection. |
void |
destroy()
Free all resources related to this collection. |
void |
disconnect()
Disconnect from the repository. |
BibRefQuery |
find(java.lang.String[] keywords,
java.lang.String[] attrs,
java.util.Hashtable properties)
Query the current collection and return another collection which is a subset of the current collection containing results of the specified query. |
BibRefQuery |
findByAuthor(BiblioProvider author,
java.util.Hashtable properties)
Query the current collection and return another collection which is a subset of the current collection containing results of the specified query. |
BibRef |
findById(java.lang.String bibRefId)
Query the current collection to find a citation with the given ID. |
BibRef |
findById(java.lang.String bibRefId,
java.lang.String[] onlyAttrs)
Query the current collection to find a citation with the given ID. |
java.lang.String |
findByIdAsXML(java.lang.String bibRefId)
Query the current collection to find a citation with the given ID, and return it in an XML format. |
BibRef[] |
getAllBibRefs()
Return all citations from the current collection. |
BibRef[] |
getAllBibRefs(java.lang.String[] onlyAttrs)
Return all citations from the current collection. |
java.io.InputStream |
getAllBibRefsAsXML()
Return all citations from the current collection as an XML stream. |
java.lang.String[] |
getAllIDs()
Return only IDs of all citations in the current collection. |
java.lang.String |
getBibRefAsXML(BibRef bibRef)
Return an XML representation of the given citation. |
int |
getBibRefCount()
Return the number of citation in the current collection. |
java.util.Enumeration |
getBibRefs()
Return an enumeration of all citations from the current collection. |
java.util.Enumeration |
getBibRefs(java.lang.String[] onlyAttrs)
Return an enumeration of all citations from the current collection. |
java.util.Enumeration |
getBibRefsAsXML()
Return an enumeration of all citations from the current collection. |
byte[] |
getCollectionId()
Return an identification of the current collection. |
boolean |
isReady()
Check if the repository is available. |
BibRefQuery |
query(java.lang.String query,
java.util.Hashtable properties)
Query the current collection and return another collection which is a subset of the current collection containing results of the specified query. |
BibRefQuery |
sort(java.lang.String[] orderedBy,
java.util.Hashtable properties)
Sort the current collection and return another collection which is a sorted copy of the current collection. |
| Field Detail |
|---|
static final java.lang.String PROP_EXCLUDED_ATTRS
find(java.lang.String[], java.lang.String[], java.util.Hashtable),
query(java.lang.String, java.util.Hashtable),
Constant Field Valuesstatic final java.lang.String PROP_CRITERIONS
find(java.lang.String[], java.lang.String[], java.util.Hashtable),
query(java.lang.String, java.util.Hashtable),
Constant Field Values| Method Detail |
|---|
byte[] getCollectionId()
connect() or after the first query, the identification may
contain information rich enough to be able to re-create the whole
collection (e.g. it can contain IDs of all records in the given
collection).
An implementation is not required to provide a persistent collection
identification. However, if it does provide, it should also be able to
accept the same identifier in the connect() method, and to use
it to re-create the same collection.
void connect()
throws BQSException
BQSException - if the connection cannot be established
void connect(byte[] collectionId)
throws BQSException
collectionId - a (usually persistent) token allowing to re-create a
collection; the parameter is the same as an identifier returned
earlier by method getCollectionId()
BQSException - if the connection cannot be established, or if the
collection with the given ID cannot be re-created.boolean isReady()
void disconnect()
BibRefQuery find(java.lang.String[] keywords,
java.lang.String[] attrs,
java.util.Hashtable properties)
throws BQSException
PROP_EXCLUDED_ATTRS is of type String[] and
contains list of attributes names which should be ignored and not
included in the results.
PROP_CRITERIONS is also of type String[] and
contains list of criteria names. The caller specifies here what
criteria she wishes, and this method can change this property and
return here the criteria really used for the query.
keywords - keyword or phrases that are being looked forattrs - attributes names that should be searchedproperties - specify attributes excluded from the results and
requested criteria for the query
BQSException - if query failed (which can have many reasons :-))query(java.lang.String, java.util.Hashtable)
BibRefQuery query(java.lang.String query,
java.util.Hashtable properties)
throws BQSException
PROP_EXCLUDED_ATTRS is of type String[] and
contains list of attributes names which should be ignored and not
included in the results.
PROP_CRITERIONS is also of type String[] and
contains list of criteria names. The caller specifies here what
criteria she wishes, and this method can change this property and
return here the criteria really used for the query.
query - an expression in a query languageproperties - specify attributes excluded from the results and
requested criteria for the query
BQSException - if query failed (which can have many reasons :-))find(java.lang.String[], java.lang.String[], java.util.Hashtable)
BibRefQuery findByAuthor(BiblioProvider author,
java.util.Hashtable properties)
throws BQSException
PROP_EXCLUDED_ATTRS is of type String[] and
contains list of attributes names which should be ignored and not
included in the results.
PROP_CRITERIONS is also of type String[] and
contains list of criteria names. The caller specifies here what
criteria she wishes, and this method can change this property and
return here the criteria really used for the query.
author - specifies one or more attributes that are being search
for; for example, a search for citations written by authors with
surname "Doe" will use 'author' object filled only with
attribute 'surname'properties - specify attributes excluded from the results and
requested criteria for the query
BQSException - if query failed (which can have many reasons :-))find(java.lang.String[], java.lang.String[], java.util.Hashtable)
BibRef findById(java.lang.String bibRefId)
throws BQSException
bibRefId - an identifier of a citation that is being looked for
BQSException - if such citation was not found (or something else
bad happened)findById(String,String[])
BibRef findById(java.lang.String bibRefId,
java.lang.String[] onlyAttrs)
throws BQSException
PROP_EXCLUDED_ATTRS, e.g in method find(java.lang.String[], java.lang.String[], java.util.Hashtable)) one cannot expect
to get them even if they are asked for by the parameter
onlyAttrs.
bibRefId - an identifier of a citation that is being looked foronlyAttrs - DOCUMENT ME!
BQSException - if such citation was not found (or something else
bad happened)findById(String)
java.lang.String findByIdAsXML(java.lang.String bibRefId)
throws BQSException
bibRefId - an identifier of a citation that is being looked for
BQSException - if such citation was not found (or something else
bad happened)
int getBibRefCount()
throws BQSException
BQSException - if a connection with the repository is broken
BibRefQuery sort(java.lang.String[] orderedBy,
java.util.Hashtable properties)
throws BQSException
PROP_CRITERIONS (of type String[]) containing a list of
sorting criteria names. The caller specifies here what criteria she
wishes, and this method can change this property and return here the
criteria really used for sorting.
orderedBy - a list of attributenames that the collection should be
sorted byproperties - DOCUMENT ME!
BQSException - if sorting failed (which may also happen when the
collection is too large)
BibRef[] getAllBibRefs()
throws BQSException
PROP_EXCLUDED_ATTRS was used
for creating the current collection.
BQSException - if the collection is too large, or if the
connection to the repository is brokengetAllBibRefs(String[]),
find(java.lang.String[], java.lang.String[], java.util.Hashtable),
query(java.lang.String, java.util.Hashtable),
findByAuthor(org.jscience.bibliography.BiblioProvider, java.util.Hashtable)
BibRef[] getAllBibRefs(java.lang.String[] onlyAttrs)
throws BQSException
PROP_EXCLUDED_ATTRS, e.g in method find(java.lang.String[], java.lang.String[], java.util.Hashtable)) one cannot expect
to get them even if they are asked for by the parameter
onlyAttrs.
onlyAttrs - DOCUMENT ME!
BQSException - if the collection is too large, or if the
connection to the repository is brokengetAllBibRefs(),
query(java.lang.String, java.util.Hashtable),
findByAuthor(org.jscience.bibliography.BiblioProvider, java.util.Hashtable)
java.lang.String[] getAllIDs()
throws BQSException
BQSException - if the collection is too large, or if the
connection to the repository is broken
java.util.Enumeration getBibRefs()
throws BQSException
PROP_EXCLUDED_ATTRS was
used for creating the current collection.
BQSException - if the connection to the repository is brokengetAllBibRefs(),
getBibRefs(String[])
java.util.Enumeration getBibRefs(java.lang.String[] onlyAttrs)
throws BQSException
PROP_EXCLUDED_ATTRS, e.g in method find(java.lang.String[], java.lang.String[], java.util.Hashtable)) one cannot expect
to get them even if they are asked for by the parameter
onlyAttrs.
onlyAttrs - DOCUMENT ME!
BQSException - if the connection to the repository is brokengetAllBibRefs(),
getBibRefs()
java.io.InputStream getAllBibRefsAsXML()
throws BQSException
PROP_EXCLUDED_ATTRS was used for creating the current collection.
BQSException - if the collection is too large, or if the
connection to the repository is brokengetAllBibRefs()
java.util.Enumeration getBibRefsAsXML()
throws BQSException
PROP_EXCLUDED_ATTRS was used for
creating the current collection.
Note that it is not the same as with getAllBibRefsAsXML() where
the return type is an InputStream (and not the String).
BQSException - if the connection to the repository is brokengetBibRefs(),
getAllBibRefsAsXML()
java.lang.String getBibRefAsXML(BibRef bibRef)
throws BQSException
bibRef - a citation being converted into an XML format
BQSException - if the implementation needs it :-)
void destroy()
throws BQSException
BQSException - if the connection to the repository is broken
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||