### Eclipse Workspace Patch 1.0 #P gbif-api Index: src/main/java/org/gbif/api/model/occurrence/search/OccurrenceSearchParameter.java =================================================================== --- src/main/java/org/gbif/api/model/occurrence/search/OccurrenceSearchParameter.java (revision 1082) +++ src/main/java/org/gbif/api/model/occurrence/search/OccurrenceSearchParameter.java (working copy) @@ -1,12 +1,9 @@ /* * Copyright 2012 Global Biodiversity Information Facility (GBIF) - * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,27 +21,38 @@ YEAR("year"), MONTH("month"), DAY("day"), + DATE("date"), LATITUDE("latitude"), LONGITUDE("longitude"), + COORDINATE("coordinate"), + BOUNDING_BOX("bbox"), COUNTRY_CODE("countryCode"), CATALOGUE_NUMBER("catalogueNumber"), COLLECTOR_NAME("collectorName"), BASIS_OF_RECORD("basisOfRecord"), NUB_KEY("nubKey"), DATASET_KEY("datasetKey"), - COORDINATE("coordinate"), KINGDOM_KEY("kingdomKey"), PHYLUM_KEY("phylumKey"), CLASS_KEY("classKey"), ORDER_KEY("orderKey"), FAMILY_KEY("familyKey"), GENUS_KEY("genusKey"), - SPECIES_KEY("speciesKey"), - HIGHER_TAXON_KEY("higherTaxonKey"); + SPECIES_KEY("speciesKey"); private final String param; + /** + * Default constructor. + * + * @param param http parameter name + */ + OccurrenceSearchParameter(String param) { + this.param = param; + } + + /** * Get an {@link OccurrenceSearchParameter} by its parameter name. */ public static OccurrenceSearchParameter getByParam(String paramName) { @@ -56,10 +64,6 @@ return null; } - OccurrenceSearchParameter(String param) { - this.param = param; - } - /** * @return the http request parameter name */ Index: src/main/java/org/gbif/api/model/occurrence/search/Constants.java =================================================================== --- src/main/java/org/gbif/api/model/occurrence/search/Constants.java (revision 1082) +++ src/main/java/org/gbif/api/model/occurrence/search/Constants.java (working copy) @@ -1,12 +1,9 @@ /* * Copyright 2012 Global Biodiversity Information Facility (GBIF) - * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,6 +20,8 @@ public static final String SEARCH_PATH = "search"; + public static final String LIMIT = "limit"; + public static final String COLLECTOR_NAME_PATH = "collectorName"; public static final String CATALOGUE_NUMBER_PATH = "catalogueNumber"; Index: src/main/java/org/gbif/api/service/occurrence/OccurrenceSearchService.java =================================================================== --- src/main/java/org/gbif/api/service/occurrence/OccurrenceSearchService.java (revision 1082) +++ src/main/java/org/gbif/api/service/occurrence/OccurrenceSearchService.java (working copy) @@ -1,12 +1,9 @@ /* * Copyright 2012 Global Biodiversity Information Facility (GBIF) - * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,6 +17,7 @@ import org.gbif.api.model.occurrence.search.OccurrenceSearchRequest; import java.util.List; + import javax.annotation.Nullable; /** @@ -37,20 +35,22 @@ /** * Searches catalogue numbers which start with the input prefix. - * + * The limit default is 4. If the limit is set to a number less than 0, then no maximum limit is enforced. + * * @param prefix search pattern - * + * @param limit maximum number of terms to return. * @return of catalogue numbers */ - List suggestCatalogueNumbers(String prefix); + List suggestCatalogueNumbers(String prefix, int limit); /** * Searches collector names which start with the input prefix. - * + * The limit default is 4. If the limit is set to a number less than 0, then no maximum limit is enforced. + * * @param prefix search pattern - * + * @param limit maximum number of terms to return. * @return of collector names */ - List suggestCollectorNames(String prefix); + List suggestCollectorNames(String prefix, int limit); }