@Test public void testSearchAttributes() throws Exception { SearchAttributesRequest request = new SearchAttributesRequest(); request.setLayerId(LAYER_ID); request.setAttributePath("manyToOneAttr"); SearchAttributesResponse response = (SearchAttributesResponse) dispatcher.execute( SearchAttributesRequest.COMMAND, request, null, "en"); if (response.isError()) { response.getErrors().get(0).printStackTrace(); } Assert.assertFalse(response.isError()); List<Attribute<?>> attributes = response.getAttributes(); Assert.assertNotNull(attributes); Assert.assertEquals(2, attributes.size()); }
@Override public void execute(SearchAttributesRequest request, SearchAttributesResponse response) throws Exception { String layerId = request.getLayerId(); if (null == layerId) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer"); } Filter filter = Filter.INCLUDE; if (request.getFilter() != null) { filter = filterService.parseFilter(request.getFilter()); } List<Attribute<?>> attributes = layerService.getAttributes(layerId, request.getAttributePath(), filter); response.setAttributes(attributes); }
SearchAttributesCommand implements CommandHasRequest<SearchAttributesRequest, SearchAttributesResponse> { @Override public void execute(SearchAttributesRequest request, SearchAttributesResponse response) throws Exception { String layerId = request.getLayerId(); if (null == layerId) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer"); } Filter filter = Filter.INCLUDE; if (request.getFilter() != null) { filter = filterService.parseFilter(request.getFilter()); } List<Attribute<?>> attributes = layerService.getAttributes(layerId, request.getAttributePath(), filter); response.setAttributes(attributes); } }
SearchAttributesCommand implements CommandHasRequest<SearchAttributesRequest, SearchAttributesResponse> { @Override public void execute(SearchAttributesRequest request, SearchAttributesResponse response) throws Exception { String layerId = request.getLayerId(); if (null == layerId) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer"); } Filter filter = Filter.INCLUDE; if (request.getFilter() != null) { filter = filterService.parseFilter(request.getFilter()); } List<Attribute<?>> attributes = layerService.getAttributes(layerId, request.getAttributePath(), filter); response.setAttributes(attributes); }  }
SearchAttributesCommand implements CommandHasRequest<SearchAttributesRequest, SearchAttributesResponse> { @Override public void execute(SearchAttributesRequest request, SearchAttributesResponse response) throws Exception { String layerId = request.getLayerId(); if (null == layerId) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer"); } Filter filter = Filter.INCLUDE; if (request.getFilter() != null) { filter = filterService.parseFilter(request.getFilter()); } List<Attribute<?>> attributes = layerService.getAttributes(layerId, request.getAttributePath(), filter); response.setAttributes(attributes); }  @Override SearchAttributesRequest getEmptyCommandRequest(); @Override SearchAttributesResponse getEmptyCommandResponse(); @Override void execute(SearchAttributesRequest request, SearchAttributesResponse response); }
SearchAttributesCommand implements CommandHasRequest<SearchAttributesRequest, SearchAttributesResponse> { @Override public void execute(SearchAttributesRequest request, SearchAttributesResponse response) throws Exception { String layerId = request.getLayerId(); if (null == layerId) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer"); } Filter filter = Filter.INCLUDE; if (request.getFilter() != null) { filter = filterService.parseFilter(request.getFilter()); } List<Attribute<?>> attributes = layerService.getAttributes(layerId, request.getAttributePath(), filter); response.setAttributes(attributes); }  @Override SearchAttributesRequest getEmptyCommandRequest(); @Override SearchAttributesResponse getEmptyCommandResponse(); @Override void execute(SearchAttributesRequest request, SearchAttributesResponse response);  }