Examples of RestQuery


Examples of ca.uhn.fhir.model.dstu.resource.Conformance.RestQuery

          if (searchParameters.isEmpty()) {
            continue;
          }
          boolean allOptional = searchParameters.get(0).isRequired() == false;

          RestQuery query = null;
          if (!allOptional) {
            query = rest.addQuery();
            query.getDocumentation().setValue(searchMethodBinding.getDescription());
            query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
            for (String nextInclude : searchMethodBinding.getIncludes()) {
              query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
            }
          }

          for (SearchParameter nextParameter : searchParameters) {

            String nextParamName = nextParameter.getName();
            String chain = null;
            if (nextParamName.contains(".")) {
              chain = nextParamName.substring(nextParamName.indexOf('.') + 1);
              nextParamName = nextParamName.substring(0, nextParamName.indexOf('.'));
            }

            String nextParamDescription = nextParameter.getDescription();

            /*
             * If the parameter has no description, default to the one from the resource
             */
            if (StringUtils.isBlank(nextParamDescription)) {
              RuntimeSearchParam paramDef = def.getSearchParam(nextParamName);
              if (paramDef != null) {
                nextParamDescription = paramDef.getDescription();
              }
            }

            RestResourceSearchParam param;
            if (query == null) {
              param = resource.addSearchParam();
            } else {
              param = query.addParameter();
              param.addUndeclaredExtension(false, ExtensionConstants.PARAM_IS_REQUIRED, new BooleanDt(nextParameter.isRequired()));
            }

            param.setName(nextParamName);
            if (StringUtils.isNotBlank(chain)) {
View Full Code Here

Examples of ca.uhn.fhir.model.dstu.resource.Conformance.RestQuery

          if (searchParameters.isEmpty()) {
            continue;
          }
          boolean allOptional = searchParameters.get(0).isRequired() == false;

          RestQuery query = null;
          if (!allOptional) {
            query = rest.addQuery();
            query.getDocumentation().setValue(searchMethodBinding.getDescription());
            query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
            for (String nextInclude : searchMethodBinding.getIncludes()) {
              query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
            }
          }

          for (SearchParameter nextParameter : searchParameters) {

            String nextParamName = nextParameter.getName();

//            String chain = null;
            String nextParamUnchainedName = nextParamName;
            if (nextParamName.contains(".")) {
//              chain = nextParamName.substring(nextParamName.indexOf('.') + 1);
              nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.'));
            }

            String nextParamDescription = nextParameter.getDescription();

            /*
             * If the parameter has no description, default to the one from the resource
             */
            if (StringUtils.isBlank(nextParamDescription)) {
              RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName);
              if (paramDef != null) {
                nextParamDescription = paramDef.getDescription();
              }
            }

            RestResourceSearchParam param;
            if (query == null) {
              param = resource.addSearchParam();
            } else {
              param = query.addParameter();
              param.addUndeclaredExtension(false, ExtensionConstants.PARAM_IS_REQUIRED, new BooleanDt(nextParameter.isRequired()));
            }

            param.setName(nextParamName);
//            if (StringUtils.isNotBlank(chain)) {
View Full Code Here

Examples of ca.uhn.fhir.model.dstu.resource.Conformance.RestQuery

          if (searchParameters.isEmpty()) {
            continue;
          }
          boolean allOptional = searchParameters.get(0).isRequired() == false;

          RestQuery query = null;
          if (!allOptional) {
            query = rest.addQuery();
            query.getDocumentation().setValue(searchMethodBinding.getDescription());
            query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
            for (String nextInclude : searchMethodBinding.getIncludes()) {
              query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
            }
          }

          for (SearchParameter nextParameter : searchParameters) {

            String nextParamName = nextParameter.getName();

//            String chain = null;
            String nextParamUnchainedName = nextParamName;
            if (nextParamName.contains(".")) {
//              chain = nextParamName.substring(nextParamName.indexOf('.') + 1);
              nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.'));
            }

            String nextParamDescription = nextParameter.getDescription();

            /*
             * If the parameter has no description, default to the one from the resource
             */
            if (StringUtils.isBlank(nextParamDescription)) {
              RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName);
              if (paramDef != null) {
                nextParamDescription = paramDef.getDescription();
              }
            }

            RestResourceSearchParam param;
            if (query == null) {
              param = resource.addSearchParam();
            } else {
              param = query.addParameter();
              param.addUndeclaredExtension(false, ExtensionConstants.PARAM_IS_REQUIRED, new BooleanDt(nextParameter.isRequired()));
            }

            param.setName(nextParamName);
//            if (StringUtils.isNotBlank(chain)) {
View Full Code Here

Examples of com.esri.gpt.catalog.discovery.rest.RestQuery

    super.execute(request, response, context);
  }
 
  @Override
  protected RestQuery parseRequest(HttpServletRequest request, RequestContext context) {
    RestQuery query = new RestQuery();
    RestQueryParser parser = new ErosQueryParser(request,context,query,defaultParameters);
  
    parser.parseResponseFormat("f");
    String requestURI = Val.chkStr(request.getRequestURI());
    if (requestURI.toLowerCase().endsWith("/sitemap")) {
      String tmp = Val.chkStr(query.getResponseFormat());
      if (tmp.length() == 0) {
        query.setResponseFormat("sitemap");
      }
    }
   
    parser.parseRepositoryId("rid");
    parser.parseResponseFormat("f");
View Full Code Here

Examples of com.esri.gpt.catalog.discovery.rest.RestQuery

 
  RequestContext rc = null;
  try {
      // rc = RequestContext.extract(this.getSearchContext().getHttpRequest());
    rc = this.getSearchContext().getRequestContext();
    RestQuery query = this.getSearchContext().getRestQuery();

    SearchStatus status = this.getSearchStatus();
    status.setStartTimestamp(new Timestamp(System.currentTimeMillis()));
  
    if (this.isTimeUp()) {
View Full Code Here

Examples of com.esri.gpt.catalog.discovery.rest.RestQuery

public class CustomRestQueryServlet extends RestQueryServlet {
private static String REST_PARAM_KEY1 = "hierarchy";
//Relate the rest queryable to the CSW queryables
protected RestQuery parseRequest(HttpServletRequest request, RequestContext context) {
Logger LOG = Logger.getLogger(RestQuery.class.getCanonicalName());
  RestQuery query = super.parseRequest(request, context);
RestQueryParser parser = new RestQueryParser(request,context,query);
// "hierarchy" will be the name of the rest queryable
parser.parsePropertyIsLike(REST_PARAM_KEY1, "apiso.Type");
/** The below is shown as an example
parser.parseRepositoryId("rid");
View Full Code Here

Examples of com.esri.gpt.catalog.discovery.rest.RestQuery

  MessageBroker msgBroker = new FacesContextBroker(request, response)
      .extractMessageBroker();

  // parse the query
  RestQuery query = null;
  PrintWriter printWriter = null;

 
  try {
  
    query = parseRequest(request, context);
    if (query == null)
      query = new RestQuery();
    this.executeQuery(request, response, context, msgBroker, query);
     
  } catch (Exception e) {
    LOG.log(Level.SEVERE, "Error executing query.", e);
    String msg = Val.chkStr(e.getMessage());
View Full Code Here

Examples of com.esri.gpt.catalog.discovery.rest.RestQuery

        extraMap.put(PARAM_KEY_SHOW_THUMBNAIL, "false");
      }
    }

    // parse the query
    RestQuery query = null;
    try {
      query = parseRequest(request, context);
    } catch (Throwable t) {
      getLogger().log(Level.SEVERE, "Error parsing request.", t);
    }
    if (query == null) {
      query = new RestQuery();
    }


    // establish the response content type, print writer and feed writer
    RestQueryServlet.ResponseFormat format = getResponseFormat(request, query);
    String sFormat = getRequestParameter(request, "f");
    FeedWriter2 feedWriter2 = WriterFactory.createWriter(
            sFormat, msgBroker, query, request, response, context);
    FeedWriter feedWriter = null;
    PrintWriter printWriter = null;
    if (feedWriter2 != null) {
      feedWriter = (FeedWriter) feedWriter2;
    } else {
      this.setResponseContentType(request, response, query);
      printWriter = response.getWriter();
      feedWriter = makeFeedWriter(request, context, printWriter, msgBroker, query);
    }
    // execute the query, write the response
    try {
      if (format == RestQueryServlet.ResponseFormat.xjson) {
        String callback = request.getParameter("callback");
        if (callback != null) {
          printWriter.print(callback + "(");
        }

        // init query
        query.setReturnables(new CoreQueryables(context).getFull());
        toSearchCriteria(request, context, query);
       
       
        feedWriter.write(JsonSearchEngine.createInstance().search(request, response, context, query));

        if (callback != null) {
          printWriter.print(")");
        }

      }else if (format == RestQueryServlet.ResponseFormat.dcat) {
       
        String callback = request.getParameter("callback");
        if (callback != null) {
          printWriter.print(callback + "(");
        }
       
        // The following part of the code has been disabled since DCAT content
        // is being cached.
        query.setReturnables(new CoreQueryables(context).getFull());
        toSearchCriteria(request, context, query);
        feedWriter.write(DcatJsonSearchEngine.createInstance().search(request, response, context, query));

        if (callback != null) {
          printWriter.print(")");
View Full Code Here

Examples of com.esri.gpt.catalog.discovery.rest.RestQuery

   * @param request the HTTP request
   * @param context the request context
   * @return the populated rest query
   */
  protected RestQuery parseRequest(HttpServletRequest request, RequestContext context) {
    RestQuery query = new RestQuery();
    RestQueryParser parser = new RestQueryParser(request, context, query);

    parser.parseResponseFormat("f");
    String requestURI = Val.chkStr(request.getRequestURI());
    if (requestURI.toLowerCase().endsWith("/sitemap")) {
      String tmp = Val.chkStr(query.getResponseFormat());
      if (tmp.length() == 0) {
        query.setResponseFormat("sitemap");
      }
    }

    parser.parseRepositoryId("rid");
    parser.parseResponseFormat("f");
View Full Code Here

Examples of com.esri.gpt.catalog.discovery.rest.RestQuery

   * @return the search criteria object
   */
  protected SearchCriteria toSearchCriteria(HttpServletRequest request,
          RequestContext context, RestQuery query) {
    SearchCriteria criteria = new SearchCriteria();
    RestQueryParser parser = new RestQueryParser(request, context, new RestQuery());

    // keyword filter
    String sKeyword = Val.chkStr(parser.getRequestParameter("searchText"));
    if (sKeyword.length() > 0) {
      SearchFilterKeyword fKeyword = new SearchFilterKeyword();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.