Package org.fao.geonet.csw.common

Examples of org.fao.geonet.csw.common.CswOperation


    //--- setup get-record-by-id request

    request = new GetRecordByIdRequest(sc);
    request.setElementSetName(ElementSetName.FULL);

    CswOperation oper = server.getOperation(CswServer.GET_RECORD_BY_ID);

    // Use the preferred HTTP method and check one exist.
    if (oper.getGetUrl() != null && Harvester.PREFERRED_HTTP_METHOD.equals("GET")) {
      request.setUrl(oper.getGetUrl());
      request.setMethod(GET);
    } else if (oper.getPostUrl() != null && Harvester.PREFERRED_HTTP_METHOD.equals("POST")) {
      request.setUrl(oper.getPostUrl());
      request.setMethod(POST);
    } else {
      if (oper.getGetUrl() != null) {
        request.setUrl(oper.getGetUrl());
        request.setMethod(GET);
      } else if (oper.getPostUrl() != null) {
        request.setUrl(oper.getPostUrl());
        request.setMethod(POST);
      } else {
        throw new OperationAbortedEx("No GET or POST DCP available in this service.");
      }
    }

    if(oper.getPreferredOutputSchema() != null) {
      request.setOutputSchema(oper.getPreferredOutputSchema());
    }

        if(oper.getPreferredServerVersion() != null) {
      request.setServerVersion(oper.getPreferredServerVersion());
    }

    if (params.useAccount) {
      request.setCredentials(params.username, params.password);
   
View Full Code Here

TOP

Related Classes of org.fao.geonet.csw.common.CswOperation

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.