Package com.luciad.ogc.csw.server
Class TLcdCSWOpenSearchTemplate
java.lang.Object
com.luciad.ogc.csw.server.TLcdCSWOpenSearchTemplate
Represents an OpenSearch template. This class hold all the information needed to create and interpret
OpenSearch queries.
You can create instances of this class using a
builder
.
Here's an example to create the template
http://example.com/?q={searchTerms}&pw={startPage?}&format=rss
TLcdCSWOpenSearchTemplate template = TLcdCSWOpenSearchTemplate.newBuilder()
.addAnyTextKeyword("q")
.addStartPageKeyword("pw", true)
.outputFormat(OutputFormat.ATOM)
.build();
- Since:
- 2017.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class forTLcdCSWOpenSearchTemplate
instances. -
Field Summary
Modifier and TypeFieldDescriptionstatic final QName
Allows specifying the number of search results per page desired by the search client.static final QName
Allows specifying the bounding box to search for geospatial results within.static final QName
Allows specifying a geometry defined using the Well Known Text (WKT) standard (e.g.static final QName
Allows specifying the latitude in decimal degrees in EPSG:4326 (WGS 84).static final QName
Allows specifying the longitude in decimal degrees in EPSG:4326 (WGS 84).static final QName
Allows specifying the search distance from the provided longitude and latitude.static final QName
Allows specifying the spatial relation of the search.static final QName
Allows specifying the identifier of the resource within the search engine context.static final QName
Allows specifying the OpenSearch "searchTerms" parameter, matching one or more keywords.static final QName
Allows specifying the index of the first search result.static final QName
Allows specifying the page number of the set of search results desired by the search client.static final QName
Allows specifying the end time formatted as YYYY-MM-DDTHH:mm:ssZ, cfr RFC-3339 (e.g.static final QName
Allows specifying the temporal relation to use when specifying the time parameters.static final QName
Allows specifying the start time formatted as YYYY-MM-DDTHH:mm:ssZ, cfr RFC-3339 (e.g. -
Method Summary
Modifier and TypeMethodDescriptionGets all parameters that are part of this templategetKeys()
Gets a list of keys defined by thisTLcdCSWOpenSearchTemplate
Gets the output format for this templategetParameters
(String aKey) Gets the parameter value for the given keyisKeyOptional
(String aKey) Checks whether the given key is optional.Creates a new builder for OpenSearch templates.toString()
Creates a KVP string for this template, as described in the OpenSearch standard.
-
Field Details
-
START_PAGE_QNAME
Allows specifying the page number of the set of search results desired by the search client. -
START_INDEX_QNAME
Allows specifying the index of the first search result. If not specific in the query, '1' is assumed. -
COUNT_QNAME
Allows specifying the number of search results per page desired by the search client. -
GEO_BOX_QNAME
Allows specifying the bounding box to search for geospatial results within. The box is defined by "west, south, east, north" coordinates of longitude, latitude, in a EPSG:4326 decimal degrees. -
GEO_UID_QNAME
Allows specifying the identifier of the resource within the search engine context. -
GEO_GEOMETRY_QNAME
Allows specifying a geometry defined using the Well Known Text (WKT) standard (e.g. POINT, LINESTRING, POLYGON). -
GEO_RELATION_QNAME
Allows specifying the spatial relation of the search. By default the geo searches return the records that intersect the query. -
GEO_LON_QNAME
Allows specifying the longitude in decimal degrees in EPSG:4326 (WGS 84). -
GEO_LAT_QNAME
Allows specifying the latitude in decimal degrees in EPSG:4326 (WGS 84). -
GEO_RADIUS_QNAME
Allows specifying the search distance from the provided longitude and latitude. The distance is in meters along the Earth's surface. -
TIME_START_QNAME
Allows specifying the start time formatted as YYYY-MM-DDTHH:mm:ssZ, cfr RFC-3339 (e.g. 1996-12-19T16:39:57-08:00) -
TIME_END_QNAME
Allows specifying the end time formatted as YYYY-MM-DDTHH:mm:ssZ, cfr RFC-3339 (e.g. 1996-12-19T16:39:57-08:00) -
TIME_RELATION_QNAME
Allows specifying the temporal relation to use when specifying the time parameters.- See Also:
-
SEARCH_TERMS_QNAME
Allows specifying the OpenSearch "searchTerms" parameter, matching one or more keywords. When performing an OpenSearch query, multiple terms can be specified, separated by commas. The query will return matches for any of the terms (e.g. q="term 1, term 2" means match "term 1" OR "term 2"). If you need to construct a template to match all terms you could define mulitple searchTerms parameters (e.g.q1="term1"&q2="term2"
means match "term 1" AND "term 2".
-
-
Method Details
-
getOutputFormat
Gets the output format for this template- Returns:
- The output format for this template
-
getKeys
Gets a list of keys defined by thisTLcdCSWOpenSearchTemplate
- Returns:
- A list of keys
-
getAllParameters
Gets all parameters that are part of this template- Returns:
- A list of parameters in this template
-
isKeyOptional
Checks whether the given key is optional.- Parameters:
aKey
- a key- Returns:
- true if the key is optional; false otherwise. Null is returned if the key is not part of this template.
-
getParameters
Gets the parameter value for the given key- Parameters:
aKey
- a key- Returns:
- The parameter value, or null if the key is not part of this template
-
toString
Creates a KVP string for this template, as described in the OpenSearch standard. -
newBuilder
Creates a new builder for OpenSearch templates.- Returns:
- a new builder
- See Also:
-