Class TLcdCSWQuery

All Implemented Interfaces:
ILcdDataObject, ILcdCloneable, ILcdDeepCloneable, Cloneable

public class TLcdCSWQuery extends TLcdCSWAbstractQuery
The default representation of a GetRecords request query.
  • The constraint allows filtering the records that should be retrieved
  • The typeNames (e.g. cswRecord, gmd:MD_Metadata) specify the property set that can be used to filter queries (for example, match the dc:title or apiso:title).
  • The element set name or elements specify which properties of the output record to include in the response.
  • The sortBy specifies how the resulting records should be sorted
Note that the output format itself is not specified in the query object, but rather in the TLcdCSWGetRecordsRequest or TLcdCSWGetRecordByIdRequest.
Since:
2017.0
  • Field Details

    • TYPE_NAMES_PROPERTY

      public static final TLcdDataProperty TYPE_NAMES_PROPERTY
      Data property that maps to the typeNames attribute. The possible values for this property are instances of List<QName>.
    • ELEMENTS_PROPERTY

      public static final TLcdDataProperty ELEMENTS_PROPERTY
      Data property that maps to the choice between the ElementSetName and ElementName elements. The possible values for this property are instances of
    • CONSTRAINT_PROPERTY

      public static final TLcdDataProperty CONSTRAINT_PROPERTY
      Data property that maps to the Constraint element. The possible values for this property are instances of TLcdCSWQueryConstraint.
    • SORT_BY_PROPERTY

      public static final TLcdDataProperty SORT_BY_PROPERTY
      Data property that maps to the SortBy element. The possible values for this property are instances of TLcdOGCSortBy.
  • Constructor Details

    • TLcdCSWQuery

      public TLcdCSWQuery()
    • TLcdCSWQuery

      public TLcdCSWQuery(TLcdDataType aType)
  • Method Details

    • getElementSetName

      public TLcdCSWElementSetName getElementSetName()
      Returns the element set name (e.g. brief, summary, full) that defines the properties of the output record to include in the response.
      Returns:
      the element set name defining the output properties, or null
      See Also:
    • setElementSetName

      public void setElementSetName(TLcdCSWElementSetName aSetName)
      Specifies an element set name (e.g. brief, summary, full) that defines the properties of the output record to include in the response. This method clears the value of getElements().
      Parameters:
      aSetName - the element set name defining the output properties
      See Also:
    • getElements

      public List<QName> getElements()
      Returns the set of properties of the output record to include in the response.
      Returns:
      the names of the desired output properties, or null
      See Also:
    • setElements

      public void setElements(List<QName> aElements)
      Specifies the set of properties of the output record to include in the response. This method clears the value of getElementSetName().
      Parameters:
      aElements - the names of the desired output properties
      See Also:
    • setConstraint

      public void setConstraint(TLcdCSWQueryConstraint aValue)
      Specifies which records should be retrieved. The constraint is usually based on an OGC Filter. The following snippet matches records with a specific title:
      
        TLcdOGCFilter filter = new TLcdOGCFilter(
          TLcdOGCFilterFactory.like(
          new TLcdOGCPropertyName(TLcdDCElemSimpleLiteral.TITLE),
          "My Title"
          )
        );
        query.setConstraint(new TLcdCSWQueryConstraint(filter, "1.1.0"));
       
      Make sure to declare the property set you're going to filter on.
      Parameters:
      aValue - the value to set for the CONSTRAINT_PROPERTY property.
    • getTypeNames

      public List<QName> getTypeNames()
      Returns the property sets that can be used to filter queries (for example, match the dc:title or apiso:title). You can retrieve type names from the record type constants. The following snippet adds support for filtering records using CSW 2.0.2's default Dublin Core elements (e.g. dc:title):
      
         getTypeNames().add(TLcdCSWRecordType.CSW_202.getTypeName());
       
      Returns:
      the value of the TYPE_NAMES_PROPERTY property.
      See Also:
    • setTypeNames

      public void setTypeNames(List<QName> aValue)
      Sets the value of the property that maps to the typeNames attribute.
      Parameters:
      aValue - the value to set for the TYPE_NAMES_PROPERTY property.
    • getConstraint

      public TLcdCSWQueryConstraint getConstraint()
      Returns the value of the property that maps to the Constraint element.
      Returns:
      the value of the CONSTRAINT_PROPERTY property.
    • getSortBy

      public TLcdOGCSortBy getSortBy()
      Returns the value of the property that maps to the SortBy element.
      Returns:
      the value of the SORT_BY_PROPERTY property.
    • setSortBy

      public void setSortBy(TLcdOGCSortBy aValue)
      Sets the value of the property that maps to the SortBy element.
      Parameters:
      aValue - the value to set for the SORT_BY_PROPERTY property.