Package com.esri.gpt.server.csw.provider.components

Examples of com.esri.gpt.server.csw.provider.components.OwsException


    // parse the property name
    String locator = "PropertyName";
    Node ndPropName = (Node)xpath.evaluate("ogc:PropertyName",parent,XPathConstants.NODE);
    if (ndPropName == null) {
      String msg = "The parameter was not found";
      throw new OwsException(OwsException.OWSCODE_MissingParameterValue,locator,msg);
    }
    String sPropName = Val.chkStr(ndPropName.getTextContent());
    if (sPropName.length() == 0) {
      String msg = "The parameter value was empty.";
      throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,locator,msg);
    }
   
    // find the discoverable
    Discoverable discoverable = this.getDiscoveryContext().findDiscoverable(sPropName);
    if (discoverable == null) {
      String msg = sPropName+" is not a supported queryable.";
      throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,locator,msg);
    }
    return discoverable;
  }
View Full Code Here


     
      IOriginalXmlProvider oxp = factory.makeOriginalXmlProvider(context);
      if (oxp == null) {
        String msg = "IProviderFactory.makeOriginalXmlProvider: instantiation failed.";
        LOGGER.log(Level.SEVERE,msg);
        throw new OwsException(msg);        
      } else {
        String id = qOptions.getIDs().iterator().next();
        String xml = oxp.provideOriginalXml(context,id);
        context.getOperationResponse().setResponseXml(xml);
      }
     
    } else {
     
      // evaluate the query
      IQueryEvaluator evaluator = factory.makeQueryEvaluator(context);
      if (evaluator == null) {
        String msg = "IProviderFactory.makeQueryEvaluator: instantiation failed.";
        LOGGER.log(Level.SEVERE,msg);
        throw new OwsException(msg);
      } else {
        evaluator.evaluateIdQuery(context,qOptions.getIDs().toArray(new String[0]));
      }
           
      // generate the response
      IResponseGenerator generator = factory.makeResponseGenerator(context);
      if (generator == null) {
        String msg = "IProviderFactory.makeResponseGenerator: instantiation failed.";
        LOGGER.log(Level.SEVERE,msg);
        throw new OwsException(msg);
      } else {
        generator.generateResponse(context);
      }
   
    }
View Full Code Here

    String outputSchema = qOptions.getOutputSchema();
    if ((outputSchema != null) && outputSchema.equalsIgnoreCase("original")) {
      StringSet ids = qOptions.getIDs();
      if ((ids == null) || (ids.size() != 1)) {
        String msg = "Only one Id can be requested when "+schemaLocator+"=original";
        throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,idLocator,msg);
      }
    }
  }
View Full Code Here

          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);
      }
    }
View Full Code Here

    IProviderFactory factory = context.getProviderFactory();
    IResponseGenerator generator = factory.makeResponseGenerator(context);
    if (generator == null) {
      String msg = "IProviderFactory.makeResponseGenerator: instantiation failed.";
      LOGGER.log(Level.SEVERE,msg);
      throw new OwsException(msg);
    } else {
      generator.generateResponse(context);
    }
  }
View Full Code Here

   
    // ensure that there are IDs to query
    String locator = "Id";
    if (ids == null) {
      String msg = "The Id parameter was missing.";
      throw new OwsException(OwsException.OWSCODE_MissingParameterValue,locator,msg);
    } else if (ids.length == 0) {
      String msg = "No Valid IDs were supplied.";
      throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,locator,msg);
    }
     
    // determine the queryables
   
    // determine the discoverable
    Discoverable discoverable = this.getDiscoveryContext().findDiscoverable("Id");
    if (discoverable == null) {
      String msg = "The Id queryable is not supported.";
      throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,locator,msg);
    }
   
    // build the discovery filter
    query.getFilter().setRootClause(new LogicalClause.LogicalOr());
    for (String id: ids) {
      id = Val.chkStr(id);
      if (id.length() == 0) {
        String msg = "A supplied ID was empty.";
        throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,locator,msg);
      } else {
        PropertyClause propertyClause = new PropertyClause.PropertyIsEqualTo();
        propertyClause.setTarget(discoverable);
        propertyClause.setLiteral(id);
        query.getFilter().getRootClause().getClauses().add(propertyClause);
View Full Code Here

  public void handleGet(OperationContext context, HttpServletRequest request)
    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:Transaction request URL...");
    throw new OwsException("HTTP Get is not supported for this operation.");
   
    /*
    // initialize
    LOGGER.finer("Handling csw:Transaction request URL...");
    TransactionOptions tOptions = context.getRequestOptions().getTransactionOptions();
View Full Code Here

    if (opProvider != null) {
      opProvider.handleXML(context,root,xpath);
    } else {
      locator = "csw:Transaction";
      String msg = "The transaction operation node was missing.";
      throw new OwsException(OwsException.OWSCODE_MissingParameterValue,locator,msg);
    }
  }
View Full Code Here

TOP

Related Classes of com.esri.gpt.server.csw.provider.components.OwsException

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.