Package com.esri.gpt.catalog.discovery

Examples of com.esri.gpt.catalog.discovery.Sortables


    throws OwsException, XPathExpressionException {
   
    // parse the sort option
    LOGGER.finer("Parsing sort by for "+sortByNode.getNodeName());
    DiscoveryQuery query = this.getDiscoveryContext().getDiscoveryQuery();
    Sortables sortables = new Sortables();
    NodeList nlProps = null;
    if (sortByNode != null) {
      nlProps = (NodeList)xpath.evaluate("ogc:SortProperty",sortByNode,XPathConstants.NODESET);
    }
    if ((nlProps != null) && (nlProps.getLength() > 0)) {
      for (int i=0; i<nlProps.getLength(); i++) {
        Sortable sortable = this.parsePropertyName(nlProps.item(i),xpath).asSortable();
        Node ndDir = (Node)xpath.evaluate("ogc:SortOrder",nlProps.item(i),XPathConstants.NODE);
        if (ndDir != null) {
          String sSortDir = ndDir.getTextContent();
          try {
            LOGGER.finer("Setting sort direction:"+sSortDir);
            sortable.setDirection(Sortable.SortDirection.from(sSortDir));
          } catch (IllegalArgumentException e) {
            String msg = "This parameter value is not supported: "+sSortDir;
            throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,"SortOrder",msg);
          }
        }
        sortables.add(sortable);
      }
    }
    if (sortables.size() > 0) {
      query.setSortables(sortables);
    }
  }
View Full Code Here


   * Makes the sort option for the query.
   * @param discoveryQuery the active query
   */
  private Sort makeSortOption(DiscoveryQuery discoveryQuery) {
    Sort sortOption = null;
    Sortables sortables = discoveryQuery.getSortables();
    ArrayList<SortField> sortFields = new ArrayList<SortField>();
    if ((sortables != null) && (sortables.size() > 0)) {
      Storeable storable;
      for (Sortable sortable: sortables) {
        storable = (Storeable)sortable.getStorable();
        if (storable != null) {
          DatastoreField comparisonField = storable.getComparisonField();
View Full Code Here

TOP

Related Classes of com.esri.gpt.catalog.discovery.Sortables

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.