|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.opensearch.opensearchlibrary.DescriptionDocument
public class DescriptionDocument
This is the central class of the OpenSearch library, providing functionality related to OpenSearch
description documents. A client who intends to use the library for the purpose of submitting queries
to OpenSearch-enabled providers should first instantiate this class.
On instantiation, a pre-parsed Document
object is checked for validity as an OpenSearch description
document. If the document is found valid, various operations such as the retrieval of QueryBuilder
objects
,which can be used in order to submit queries, and the querying of a number of description document related properties
are exposed to the client.
Constructor Summary | |
---|---|
DescriptionDocument(org.w3c.dom.Document descriptionDocument,
URLElementFactory urlFactory,
QueryElementFactory queryFactory)
Creates a new DescriptionDocument instance |
Method Summary | |
---|---|
boolean |
canRequest()
Determines whether the client may request search results from the OpenSearch provider corresponding to this description document |
boolean |
canSendToClients()
Determines whether the client may send the search results obtained from the OpenSearch provider corresponding to this description document to other search clients |
boolean |
canSendToEndUsers()
Determines whether the client may display the search results obtained from the OpenSearch provider corresponding to this description document to end users |
java.lang.String |
getAttribution()
Returns the String contained in the Attribution element of the description document |
java.lang.String |
getContact()
Returns the String contained in the Contact element of the description document |
java.lang.String |
getDefaultInputEncoding()
Returns the default input encoding of the OpenSearch specification |
java.lang.String |
getDefaultOutputEncoding()
Returns the default output encoding of the OpenSearch specification |
java.lang.String |
getDescription()
Returns the String contained in the Description element of the description document |
java.lang.String |
getDeveloper()
Returns the String contained in the Developer element of the description document |
java.util.List<QueryBuilder> |
getExampleQueryBuilders(java.lang.String MIMEType)
Retrieves a list of all QueryBuilder objects that can be used to send example queries as described in the Query elements of this description document. |
java.net.URI |
getImageURI()
Retrieves the URI of the image that appears in the first Image element of this description document |
java.net.URI |
getImageURI(java.lang.String MIMEType)
Retrieves the URI of the image with a specific MIME type appearing first in an Image element of this description document |
java.lang.String |
getLongName()
Returns the String contained in the LongName element of the description document |
java.lang.String |
getNSPrefix(java.lang.String NSUrl)
Retrieves the namespace prefix associated with a namespace URI in the description document |
java.util.Map<java.lang.String,java.lang.String> |
getNSPrefixToURIMappings()
|
java.lang.String |
getNSUrl(java.lang.String NSPrefix)
Retrieves the namespace URI associated with a namespace prefix in the description document |
java.util.List<QueryBuilder> |
getQueryBuilders(java.lang.String rel,
java.lang.String MIMEType)
Retrieves a list of QueryBuilder objects that can be used to construct queries for resources related to a specific role and which return results of
a given MIME type |
java.lang.String |
getShortName()
Returns the String contained in the ShortName element of the description document |
java.util.List<java.lang.String> |
getSupportedInputEncodings()
Retrieves a list of all input encodings supported by e OpenSearch provider corresponding to this description document |
java.util.List<java.lang.String> |
getSupportedLanguages()
Retrieves a list of all languages supported by the OpenSearch provider corresponding to this description document |
java.util.List<java.lang.String> |
getSupportedMimeTypes(java.lang.String rel)
Retrieves a list of MIME types supported for constructing queries for a specific role Standard OpenSearch Url rel values are: "results", "suggestion", "self" and "collection" |
java.util.List<java.lang.String> |
getSupportedOutputEncodings()
Retrieves a list of all output encodings supported by e OpenSearch provider corresponding to this description document |
SyndicationRight |
getSyndicationRight()
Returns the SyndicationRight value contained in the SyndicationRight element of the description document |
java.util.List<java.lang.String> |
getTags()
Retrieves a list of all the tags contained in the description document which identify and categorize the search content |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getUniqueTemplates()
Returns all parameter-wise unique templates contained in this description document |
java.util.Map<java.lang.String,java.lang.String> |
getURIToPrefixMappings()
|
java.lang.Boolean |
hasAdultContent()
Determines whether the search results obtained from the OpenSearch provider corresponding to this description document may contain material intended only for adults |
boolean |
hasLangRestriction()
Determines whether the description document limits the search to a set of supported languages |
boolean |
isInputEncodingSupported(java.lang.String encoding)
Determines whether a specific input encoding is supported by the OpenSearch provider corresponding to this description document |
boolean |
isLanguageSupported(java.lang.String lang)
Determines whether a specific language is supported by the OpenSearch provider corresponding to this description document |
boolean |
isOutputEncodingSupported(java.lang.String encoding)
Determines whether a specific output encoding is supported by the OpenSearch provider corresponding to this description document |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DescriptionDocument(org.w3c.dom.Document descriptionDocument, URLElementFactory urlFactory, QueryElementFactory queryFactory) throws java.lang.Exception
DescriptionDocument
instance
descriptionDocument
- A Document
corresponding to the XML document that is to be processed as a description documenturlFactory
- The factory that will be used to construct URLElement
s in order to process URL elements contained in the description documentqueryFactory
- The factory that will be used to construct QueryElement
s in order to process Query elements contained in the description document
java.lang.Exception
- In case of an error, description document validity related or otherwise.Method Detail |
---|
public java.lang.String getNSPrefix(java.lang.String NSUrl)
NSUrl
- The namespace URI
public java.lang.String getNSUrl(java.lang.String NSPrefix)
NSPrefix
- The prefix of the namespace
public java.lang.String getShortName()
public java.lang.String getLongName()
public java.lang.String getDescription()
public java.lang.String getContact()
public java.lang.String getDeveloper()
public java.lang.String getAttribution()
public SyndicationRight getSyndicationRight()
SyndicationRight
value contained in the SyndicationRight element of the description document
SyndicationRight
of the description document or null if such an element is absentpublic boolean canRequest()
public boolean canSendToEndUsers()
public boolean canSendToClients()
public java.lang.Boolean hasAdultContent()
public java.util.List<java.lang.String> getTags()
public boolean hasLangRestriction()
public boolean isLanguageSupported(java.lang.String lang)
lang
- The language to check support for
public java.util.List<java.lang.String> getSupportedLanguages()
public boolean isInputEncodingSupported(java.lang.String encoding)
encoding
- The input encoding to check support for
public java.lang.String getDefaultInputEncoding()
public java.util.List<java.lang.String> getSupportedInputEncodings()
public boolean isOutputEncodingSupported(java.lang.String encoding)
encoding
- The output encoding to check support for
public java.lang.String getDefaultOutputEncoding()
public java.util.List<java.lang.String> getSupportedOutputEncodings()
public java.net.URI getImageURI()
public java.net.URI getImageURI(java.lang.String MIMEType)
MIMEType
- The MIME type of the image to be retrieved
public java.util.List<java.lang.String> getSupportedMimeTypes(java.lang.String rel) throws java.lang.Exception
rel
- The role of the resource to be queried
java.lang.Exception
- If an error has occurredpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getUniqueTemplates() throws java.lang.Exception
java.lang.Exception
- If the URL elements of the description document are not initialized, or in case of other errorspublic java.util.List<QueryBuilder> getQueryBuilders(java.lang.String rel, java.lang.String MIMEType) throws java.lang.Exception
QueryBuilder
objects that can be used to construct queries for resources related to a specific role and which return results of
a given MIME type
rel
- The role of the resource to be queried, e.g. "results"MIMEType
- The MIME type of the results that the provider should return
QueryBuilder
s that satisfy the criteria passed as arguments. If none are found, an empty list is returned.
java.lang.Exception
- If the URL elements contained in the desription document are not initialized or in case of other errorspublic java.util.List<QueryBuilder> getExampleQueryBuilders(java.lang.String MIMEType) throws java.lang.Exception
QueryBuilder
objects that can be used to send example queries as described in the Query elements of this description document.
The result type of the queries constructed by these QueryBuilder
s will match the MIME type given as argument.
MIMEType
- The MIME type which the results obtained from queries issued using the QueryBuilder
s returned should have
QueryBuilder
objects that can be used to issue the requested example queries
java.lang.Exception
- If the URL elements contained in the desription document are not initialized or in case of other errorspublic java.util.Map<java.lang.String,java.lang.String> getNSPrefixToURIMappings()
public java.util.Map<java.lang.String,java.lang.String> getURIToPrefixMappings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |