public class LocalOpenSearchResource extends Object implements OpenSearchResource
| Constructor and Description |
|---|
LocalOpenSearchResource(File file,
File schemaFile)
Creates a new LocalOpenSearchResource whose XML representation is stored in a file
|
LocalOpenSearchResource(String xml,
File schemaFile)
Creates a new LocalOpenSearchResouce whose XML representation is stored in a String
|
LocalOpenSearchResource(String name,
URL DDUrl,
boolean brokered)
Creates a new LocalOpenSearchResource by directly providing its attributes
|
LocalOpenSearchResource(URL url,
File schemaFile)
Creates a new LocalOpenSearchResource whose XML representation can be retrieved through a URL
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTransformation(String MIMEType,
String recordSplitXPath,
String recordIdXPath,
URL XSLTUrl,
Map<String,String> presentationInfo)
Adds a transformation specification to the OpenSearch resource
|
Document |
getDescriptionDocument()
Retrieves the description document of the OpenSearch provider described by this resource
|
String |
getDescriptionDocURL()
Retrieves the URL of the description document of the OpenSearch provider described by this resource
|
String |
getName()
Returns the name of the OpenSearch provider
|
String |
getParameterQName(String fieldName)
Retrieves the fully qualified name of an OpenSearch parameter which corresponds to a field
|
Map<String,String> |
getParameters()
Retrieved the full mapping from field names to fully ns-qualified OpenSearch parameters as contained
in the OpenSearch Resource
|
Map<String,String> |
getPresentationInformation(String MIMEType)
Retrieves the presentation information, that is, a mapping from field names to XPath expressions
|
XPathExpression |
getRecordIdXPath(String MIMEType)
Retrieves an XPathExpression that can be used to extract a record id a from a search result record
|
XPathExpression |
getRecordSplitXPath(String MIMEType)
Retrieves an XPathExpression that can be used to split a search result page of a given MIME type to individual records
|
String |
getSecuritySpecs()
Retrieves the security specifications of this OpenSearch provider
|
List<String> |
getTransformationTypes()
Retrieves a list of all MIME types for which there exists a transformation specification
|
Transformer |
getTransformer()
Retrieves a transformer that can be used to transform the results of the first MIME type appearing in this OpenSearch resource
that are returned by the provider described by this resource
|
Transformer |
getTransformer(String MIMEType)
Retrieves a transformer that can be used to transform the results of a given MIME type that are
returned by the provider described by this resource
|
boolean |
isBrokered()
Determines whether the provider described by this resource returns brokered results, i.e
the results it returns describe other OpenSearch providers
|
boolean |
isSecure()
Determines if the provider described by this resource uses a security scheme
|
static void |
main(String[] args) |
public LocalOpenSearchResource(String name, URL DDUrl, boolean brokered) throws IOException, ParserConfigurationException, SAXException
name - The name of the OpenSearch resource to be createdDDUrl - The URL of the description document of the OpenSearch provider that will be associated with the OpenSearch resource to be createdbrokered - true if the OpenSearch resource to be created provides brokered results, false otherwiseIOExceptionParserConfigurationExceptionSAXExceptionpublic LocalOpenSearchResource(File file, File schemaFile) throws Exception
file - The file where the XML representation of the OpenSearch resource is storedschemaFile - The schema file describing the schema of the OpenSearch resource to be used for validation. This is an optional parameter.
If null, no validation will be performedException - If the resource is malformed or in case of other errorpublic LocalOpenSearchResource(String xml, File schemaFile) throws Exception
xml - The XML representation of the OpenSearch resource to be createdschemaFile - The schema file describing the schema of the OpenSearch resource to be used for validation. This is an optional parameter.
If null, no validation will be performedException - If the resource is malformed or in case of other errorpublic LocalOpenSearchResource(URL url, File schemaFile) throws Exception
url - The URL that will be used to retrieve the XML representation of the OpenSearch resource
to be createdschemaFile - The schema file describing the schema of the OpenSearch resource to be used for validation. This is an optional parameter.
If null, no validation will be performedException - If the resource is malformed or in case of other errorpublic void addTransformation(String MIMEType, String recordSplitXPath, String recordIdXPath, URL XSLTUrl, Map<String,String> presentationInfo) throws Exception
MIMEType - The MIME type of the results that will be associated with the transformation specificationsrecordSplitXPath - The Xpath expression to be used to split the results contained in a search result page to individual recordsrecordIdXPath - The Xpath expression to be used to extract a record id from a record of the search resultsXSLTUrl - The URL of the XSLT to be used to transform the search result records to the desired formpresentationInfo - A mapping from presentable field names to XPath expressions that will be used to extract result fields from
the results returned by the providerException - In case of errorpublic String getName()
getName in interface OpenSearchResourceOpenSearchResource.getName()public boolean isBrokered()
isBrokered in interface OpenSearchResourceOpenSearchResource.isBrokered()public boolean isSecure()
isSecure in interface OpenSearchResourceOpenSearchResource.isSecure()public String getSecuritySpecs()
getSecuritySpecs in interface OpenSearchResourceOpenSearchResource.getSecuritySpecs()public Document getDescriptionDocument()
getDescriptionDocument in interface OpenSearchResourceOpenSearchResource.getDescriptionDocument()public String getDescriptionDocURL()
getDescriptionDocURL in interface OpenSearchResourceOpenSearchResource.getDescriptionDocURL()public Transformer getTransformer(String MIMEType) throws Exception
getTransformer in interface OpenSearchResourceMIMEType - The MIME type of the results that will be transformedException - In case of errorOpenSearchResource.getTransformer(String)public XPathExpression getRecordSplitXPath(String MIMEType) throws Exception
getRecordSplitXPath in interface OpenSearchResourceMIMEType - The MIME type of the results returned by the provider described by this resourceException - In case of errorOpenSearchResource.getRecordSplitXPath(String)public XPathExpression getRecordIdXPath(String MIMEType) throws Exception
getRecordIdXPath in interface OpenSearchResourceMIMEType - The MIME type of the results returned by the provider described by this resourceException - In case of errorOpenSearchResource.getRecordIdXPath(String)public Transformer getTransformer() throws Exception
getTransformer in interface OpenSearchResourceException - In case of errororg.gcube.opensearch.opensearchoperator.resource.OpenSearchResource#getTransformer())public Map<String,String> getPresentationInformation(String MIMEType)
getPresentationInformation in interface OpenSearchResourceOpenSearchResource.getPresentationInformation(String)public List<String> getTransformationTypes()
getTransformationTypes in interface OpenSearchResourceOpenSearchResource.getTransformationTypes()public String getParameterQName(String fieldName)
OpenSearchResourcegetParameterQName in interface OpenSearchResourcefieldName - The name of the field corresponding to the requested OpenSearch parameterpublic Map<String,String> getParameters()
OpenSearchResourcegetParameters in interface OpenSearchResourceCopyright © 2014. All Rights Reserved.