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

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


    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:GetRecordById request URL...");
    QueryOptions qOptions = context.getRequestOptions().getQueryOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;
   
    // service and version are parsed by the parent RequestHandler
   
    // output format
    locator = "outputFormat";
    parsed = pHelper.getParameterValues(request,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    context.getOperationResponse().setOutputFormat(
        vHelper.validateValue(supported,locator,parsed,false));
       
    // output schema
    locator = "outputSchema";
    parsed = pHelper.getParameterValues(request,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputSchema);
    qOptions.setOutputSchema(vHelper.validateValue(supported,locator,parsed,false));
   
    // IDs
    locator = "Id";
    parsed = pHelper.getParameterValues(request,locator,",");
    qOptions.setIDs(vHelper.validateValues(locator,parsed,true));
   
    // validate the ID count if an original output schema was requested
    this.validateIfOriginalSchema(context,"Id","outputSchema");
   
    // result type
    qOptions.setResultType(CswConstants.ResultType_Results);
   
    // response element set type
    locator = "ElementSetName";
    parsed = pHelper.getParameterValues(request,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_ElementSetType);
    qOptions.setElementSetType(vHelper.validateValue(supported,locator,parsed,false));
   
    // default element set type for GetRecordById is summary
    if (Val.chkStr(qOptions.getElementSetType()).length() == 0) {
      qOptions.setElementSetType(CswConstants.ElementSetType_Summary);
View Full Code Here


    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:GetRecordById request XML...");
    QueryOptions qOptions = context.getRequestOptions().getQueryOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;

    // service and version are parsed by the parent RequestHandler
       
    // output format
    locator = "@outputFormat";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    context.getOperationResponse().setOutputFormat(
        vHelper.validateValue(supported,locator,parsed,false));
   
    // output schema
    locator = "@outputSchema";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputSchema);
    qOptions.setOutputSchema(vHelper.validateValue(supported,locator,parsed,false));
   
    // IDs
    locator = "csw:Id";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    qOptions.setIDs(vHelper.validateValues(locator,parsed,true));
   
    // validate the ID count if an original output schema was requested
    this.validateIfOriginalSchema(context,"csw:Id","@outputSchema");
   
    // result type
    qOptions.setResultType(CswConstants.ResultType_Results);
   
    // response element set type
    locator = "csw:ElementSetName";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_ElementSetType);
    qOptions.setElementSetType(vHelper.validateValue(supported,locator,parsed,false));
   
    // response element set type names
    String elementSetType = qOptions.getElementSetType();
    if (elementSetType != null) {
View Full Code Here

    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:GetCapabilities request URL...");
    CapabilityOptions cOptions = context.getRequestOptions().getCapabilityOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;
   
    // service and version and language code are parsed by the parent RequestHandler,
    // the language code is initialized within the associated IProviderFactory
               
    // output format
    locator = "acceptFormats";
    parsed = pHelper.getParameterValues(request,locator,",");
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    String outputFormat = Val.chkStr(vHelper.negotiateValue(supported,locator,parsed,false));
    if (outputFormat.length() > 0) {
      context.getOperationResponse().setOutputFormat(outputFormat);
    } else {
      locator = "outputFormat";
      parsed = pHelper.getParameterValues(request,locator);
      supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
      outputFormat = vHelper.validateValue(supported,locator,parsed,false);
      context.getOperationResponse().setOutputFormat(outputFormat);
    }
   
    // sections (an empty sections parameter should return all non-optional sections)
View Full Code Here

    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:GetCapabilities request XML...");
    CapabilityOptions cOptions = context.getRequestOptions().getCapabilityOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;

    // service and version are parsed by the parent RequestHandler
       
    // output format
    locator = "ows:AcceptFormats/ows:OutputFormat";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    String outputFormat = Val.chkStr(vHelper.negotiateValue(supported,locator,parsed,false));
    if (outputFormat.length() > 0) {
      context.getOperationResponse().setOutputFormat(outputFormat);
    } else {
      locator = "@outputFormat";
      parsed = pHelper.getParameterValues(root,xpath,locator);
      supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
      outputFormat = vHelper.validateValue(supported,locator,parsed,false);
      context.getOperationResponse().setOutputFormat(outputFormat);
    }
   
    // sections (an empty sections parameter should return all non-optional sections)
View Full Code Here

    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:GetRecords request URL...");
    QueryOptions qOptions = context.getRequestOptions().getQueryOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;
    IProviderFactory factory = context.getProviderFactory();
   
    CswNamespaces ns = new CswNamespaces();
    XPath xpath = XPathFactory.newInstance().newXPath();
    xpath.setNamespaceContext(ns.makeNamespaceContext());
   
    // service and version are parsed by the parent RequestHandler
   
    // TODO typeNames requestId distributedSearch hopCount responseHandler
    // TODO resultype validate is not applicable for a GET request?
   
    // output format
    locator = "outputFormat";
    parsed = pHelper.getParameterValues(request,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    context.getOperationResponse().setOutputFormat(
        vHelper.validateValue(supported,locator,parsed,false));
       
    // output schema
    locator = "outputSchema";
    parsed = pHelper.getParameterValues(request,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputSchema);
    qOptions.setOutputSchema(vHelper.validateValue(supported,locator,parsed,false));
   
    // start and max records
    parsed = pHelper.getParameterValues(request,"startPosition");
    if ((parsed != null) && (parsed.length) > 0) {
      qOptions.setStartRecord(Math.max(Val.chkInt(parsed[0],1),1));
    }
    parsed = pHelper.getParameterValues(request,"maxRecords");
    if ((parsed != null) && (parsed.length) > 0) {
      qOptions.setMaxRecords(Val.chkInt(parsed[0],10));
    }
   
    // result type
    locator = "resultType";
    parsed = pHelper.getParameterValues(request,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_ResultType);
    qOptions.setResultType(vHelper.validateValue(supported,locator,parsed,false));
    if (qOptions.getResultType() == null) {
      qOptions.setResultType(CswConstants.ResultType_Hits);
    }
   
    // query type names
    locator = "typeNames";
    parsed = pHelper.getParameterValues(request,locator);
    qOptions.setQueryTypeNames(vHelper.validateValues(locator,parsed,false));
   
    // response element set type
    locator = "ElementSetName";
    parsed = pHelper.getParameterValues(request,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_ElementSetType);
    qOptions.setElementSetType(vHelper.validateValue(supported,locator,parsed,false));
   
    // response element names
    if (qOptions.getElementSetType() == null) {
      // TODO supported ElementNames this for GetRecordById as well?
      locator = "ElementName";
      parsed = pHelper.getParameterValues(request,locator,",");
      supported = svcProps.getSupportedValues(CswConstants.Parameter_ElementName);
      qOptions.setElementNames(vHelper.validateValues(supported,locator,parsed,false));
    }
   
    // constraint language
    locator = "constraintLanguage";
View Full Code Here

    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:GetRecords request XML...");
    QueryOptions qOptions = context.getRequestOptions().getQueryOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;
    IProviderFactory factory = context.getProviderFactory();
   
    // service and version are parsed by the parent RequestHandler
   
    // TODO requestId
       
    // output format
    locator = "@outputFormat";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    context.getOperationResponse().setOutputFormat(
        vHelper.validateValue(supported,locator,parsed,false));
   
    // output schema
    locator = "@outputSchema";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputSchema);
    qOptions.setOutputSchema(vHelper.validateValue(supported,locator,parsed,false));
   
    // start and max records
    qOptions.setStartRecord(Math.max(Val.chkInt(xpath.evaluate("@startPosition",root),1),1));
    qOptions.setMaxRecords(Val.chkInt(xpath.evaluate("@maxRecords",root),10))
   
    // result type
    locator = "@resultType";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_ResultType);
    qOptions.setResultType(vHelper.validateValue(supported,locator,parsed,false));
    if (qOptions.getResultType() == null) {
      qOptions.setResultType(CswConstants.ResultType_Hits);
    }
   
    // find the query node
    locator = "csw:Query";
    Node ndQuery = (Node)xpath.evaluate(locator,root,XPathConstants.NODE);
    if (ndQuery != null) {
   
      // query type names
      locator = "csw:Query/@typeNames";
      parsed = pHelper.getParameterValues(root,xpath,"@typeNames");
      qOptions.setQueryTypeNames(vHelper.validateValues(locator,parsed,false));
             
      // response element set type
      locator = "csw:ElementSetName";
      parsed = pHelper.getParameterValues(ndQuery,xpath,locator);
      supported = svcProps.getSupportedValues(CswConstants.Parameter_ElementSetType);
      qOptions.setElementSetType(vHelper.validateValue(supported,locator,parsed,false));
     
      // response element set type names
      String elementSetType = qOptions.getElementSetType();
      if (elementSetType != null) {
        locator = "csw:ElementSetName/@typeNames";
        parsed = pHelper.getParameterValues(ndQuery,xpath,locator);
        qOptions.setElementSetTypeNames(vHelper.validateValues(locator,parsed,false));
      }
     
      // response element names
      if (elementSetType == null) {
        // TODO supported ElementNames
        locator = "csw:ElementName";
        parsed = pHelper.getParameterValues(ndQuery,xpath,locator);
        supported = svcProps.getSupportedValues(CswConstants.Parameter_ElementName);
        qOptions.setElementNames(vHelper.validateValues(supported,locator,parsed,false));
      }
     
      // find the constraint node
      Node ndConstraint = (Node)xpath.evaluate("csw:Constraint",ndQuery,XPathConstants.NODE);
View Full Code Here

  protected void appendDiscoveredField(OperationContext context,
                                       Element record,
                                       Returnable returnable) {
   
    // initialize
    ServiceProperties svcProps = context.getServiceProperties();
    String httpContextPath = Val.chkStr(svcProps.getHttpContextPath());
    String cswBaseUrl = Val.chkStr(svcProps.getCswBaseURL());
    OperationResponse opResponse = context.getOperationResponse();
    Document responseDom = opResponse.getResponseDom();
    PropertyMeaning meaning = returnable.getMeaning();
    PropertyMeaningType meaningType = meaning.getMeaningType();
    Object[] values = returnable.getValues();
View Full Code Here

    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:DescribeRecord request URL...");
    DescribeRecordOptions drOptions = context.getRequestOptions().getDescribeRecordOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;
   
    // service and version are parsed by the parent RequestHandler
   
    // output format
    locator = "outputFormat";
    parsed = pHelper.getParameterValues(request,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    context.getOperationResponse().setOutputFormat(
        vHelper.validateValue(supported,locator,parsed,false));
   
    // schema language
    locator = "schemaLanguage";
    parsed = pHelper.getParameterValues(request,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_SchemaLanguage);
    drOptions.setSchemaLanguage(vHelper.validateValue(supported,locator,parsed,false));
   
    // type names
    locator = "TypeName";
    parsed = pHelper.getParameterValues(request,locator,",");
View Full Code Here

    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:DescribeRecord request XML...");
    DescribeRecordOptions drOptions = context.getRequestOptions().getDescribeRecordOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;
   
    // service and version are parsed by the parent RequestHandler
   
    // output format
    locator = "@outputFormat";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    context.getOperationResponse().setOutputFormat(
        vHelper.validateValue(supported,locator,parsed,false));
   
    // schema language
    locator = "@schemaLanguage"
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_SchemaLanguage);
    drOptions.setSchemaLanguage(vHelper.validateValue(supported,locator,parsed,false));
   
    // type names
    locator = "csw:TypeName";
    parsed = pHelper.getParameterValues(root,xpath,locator);
View Full Code Here

    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:Transaction request XML...");
    TransactionOptions tOptions = context.getRequestOptions().getTransactionOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;
    NodeList nlActions;
    IOperationProvider opProvider = null;
   
    // service and version are parsed by the parent RequestHandler
   
    // output format
    locator = "@outputFormat";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    context.getOperationResponse().setOutputFormat(
        vHelper.validateValue(supported,locator,parsed,false));
   
   
    // verbose response
View Full Code Here

TOP

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

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.