Class TLcdCSWOpenSearchTemplate

java.lang.Object
com.luciad.ogc.csw.server.TLcdCSWOpenSearchTemplate

public final class TLcdCSWOpenSearchTemplate extends Object
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
  • Field Details

    • START_PAGE_QNAME

      public static final QName START_PAGE_QNAME
      Allows specifying the page number of the set of search results desired by the search client.
    • START_INDEX_QNAME

      public static final QName START_INDEX_QNAME
      Allows specifying the index of the first search result. If not specific in the query, '1' is assumed.
    • COUNT_QNAME

      public static final QName COUNT_QNAME
      Allows specifying the number of search results per page desired by the search client.
    • GEO_BOX_QNAME

      public static final QName 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

      public static final QName GEO_UID_QNAME
      Allows specifying the identifier of the resource within the search engine context.
    • GEO_GEOMETRY_QNAME

      public static final QName GEO_GEOMETRY_QNAME
      Allows specifying a geometry defined using the Well Known Text (WKT) standard (e.g. POINT, LINESTRING, POLYGON).
    • GEO_RELATION_QNAME

      public static final QName 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

      public static final QName GEO_LON_QNAME
      Allows specifying the longitude in decimal degrees in EPSG:4326 (WGS 84).
    • GEO_LAT_QNAME

      public static final QName GEO_LAT_QNAME
      Allows specifying the latitude in decimal degrees in EPSG:4326 (WGS 84).
    • GEO_RADIUS_QNAME

      public static final QName 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

      public static final QName 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

      public static final QName 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

      public static final QName TIME_RELATION_QNAME
      Allows specifying the temporal relation to use when specifying the time parameters.
      See Also:
    • SEARCH_TERMS_QNAME

      public static final QName 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

      public TLcdCSWRecordType getOutputFormat()
      Gets the output format for this template
      Returns:
      The output format for this template
    • getKeys

      public Set<String> getKeys()
      Gets a list of keys defined by this TLcdCSWOpenSearchTemplate
      Returns:
      A list of keys
    • getAllParameters

      public Set<QName> getAllParameters()
      Gets all parameters that are part of this template
      Returns:
      A list of parameters in this template
    • isKeyOptional

      public Boolean isKeyOptional(String aKey)
      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

      public List<QName> getParameters(String aKey)
      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

      public String toString()
      Creates a KVP string for this template, as described in the OpenSearch standard.
      Overrides:
      toString in class Object
      Returns:
      An OpenSearch compliant encoding of the template string
    • newBuilder

      public static TLcdCSWOpenSearchTemplate.Builder newBuilder()
      Creates a new builder for OpenSearch templates.
      Returns:
      a new builder
      See Also: