Examples of RestException


Examples of org.geomajas.rest.server.RestException

        crs = geoService.getCrs2("EPSG:" + epsg);
      }
      features = vectorLayerService.getFeatures(layerId, crs, and(filters), null, getIncludes(noGeom),
          getOffset(offset), getLimit(maxFeatures, limit));
    } catch (Exception e) {
      throw new RestException(e, RestException.PROBLEM_READING_LAYERSERVICE, layerId);
    }
    if (features.size() > 0) {
      VectorLayerInfo info = features.get(0).getLayer().getLayerInfo();
      model.addAttribute(VECTOR_LAYER_INFO, info);
      VectorLayer layer = configurationService.getVectorLayer(layerId);
View Full Code Here

Examples of org.geomajas.rest.server.RestException

      if (envelope != null) {
        try {
          return filterService.createBboxFilter(layer.getLayerInfo().getCrs(), envelope, layer
              .getFeatureModel().getGeometryAttributeName());
        } catch (LayerException e) {
          throw new RestException(e, RestException.PROBLEM_READING_LAYERSERVICE, layerId);
        }
      }
    }
    return filterService.createTrueFilter();
  }
View Full Code Here

Examples of org.geomajas.rest.server.RestException

    } else if ("gte".equalsIgnoreCase(operation)) {
      return filterService.createCompareFilter(attributeName, ">=", value);
    } else if ("like".equalsIgnoreCase(operation)) {
      return filterService.createLikeFilter(attributeName, value);
    } else {
      throw new RestException(RestException.UNSUPPORTED_QUERY_OPERATION, operation);
    }
  }
View Full Code Here

Examples of org.geomajas.rest.server.RestException

      if (attributeInfo.getName().equalsIgnoreCase(attributeName)) {
        info = attributeInfo;
      }
    }
    if (info == null) {
      throw new RestException(RestException.NO_SUCH_ATTRIBUTE, attributeName, layer.getId());
    }
    return new InternalFeatureComparator(order, attributeName);
  }
View Full Code Here

Examples of org.modeshape.web.jcr.rest.model.RestException

                               @QueryParam( "mimeType" ) String mimeType,
                               @QueryParam( "contentDisposition" ) String contentDisposition ) throws RepositoryException {
        Property binaryProperty = binaryHandler.getBinaryProperty(request, repositoryName, workspaceName, path);
        if (binaryProperty.getType() != PropertyType.BINARY) {
            return Response.status(Response.Status.NOT_FOUND)
                           .entity(new RestException("The property " + binaryProperty.getPath() + " is not a binary")).build();
        }
        Binary binary = binaryProperty.getBinary();
        if (StringUtil.isBlank(mimeType)) {
            mimeType = binaryHandler.getDefaultMimeType(binaryProperty);
        }
View Full Code Here

Examples of org.spiffyui.client.rest.RESTException

        JSONObject detail = new JSONObject();
        fault.put("Detail", detail);
        detail.put("Value1", new JSONString("First Value"));
        detail.put("Value2", new JSONString("Second Value"));
       
        RESTException exception = JSONUtil.getRESTException(obj, -1, "url");
       
        ok(null != exception, "Getting RESTException should be a value object.  It was " + exception);

        ok("Sender".equals(exception.getCode()), "Getting RESTException code should be Sender.  It was " + exception.getCode());

        ok("MessageSubcodeTest".equals(exception.getSubcode()),
           "Getting RESTException subcode should be MessageSubcodeTest.  It was " + exception.getSubcode());

        ok("Test Reason".equals(exception.getReason()),
           "Getting RESTException reason should be Test Reason.  It was " + exception.getReason());
       
        ok("First Value".equals(exception.getDetails().get("Value1")),
           "Getting RESTException details first value should be First Value.  It was " + exception.getDetails().get("Value1"));
       
        ok("Second Value".equals(exception.getDetails().get("Value2")),
           "Getting RESTException details first value should be Second Value.  It was " + exception.getDetails().get("Value2"));
       
        /*
         Now we'll test a value that isn't an NCAC fault
         */
        obj = new JSONObject();
View Full Code Here

Examples of org.springside.examples.showcase.webservice.rest.RestException

      return handleRequest(id);
    }

    // 演示服务端出错情况.
    if ("server-error".equals(status)) {
      throw new RestException(HttpStatus.INTERNAL_SERVER_ERROR, "Server Exception");
    }

    // 演示客户端请求出错。
    if ("bad-request".equals(status)) {
      throw new RestException(HttpStatus.BAD_REQUEST, "Client send a bad request");
    }

    return null;
  }
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.