-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend the API for dataverse facets retrieval (#10727)
* Added: list dataverse facets API endpoint extended to include details * Added: docs for listFacets dataverses API endpoint * Added: API endpoint for getting all facetable field types * Changed: API endpoint route for obtaining facetables dataset fields * Changed: DatasetFieldServiceApi format reset * Added: docs for #10726 * Added: release notes for #10726 * Added: IT test case for listing Dataverse facets
- Loading branch information
Showing
9 changed files
with
244 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
New optional query parameter "returnDetails" added to "dataverses/{identifier}/facets/" endpoint to include detailed information of each DataverseFacet. | ||
|
||
New endpoint "datasetfields/facetables" that lists all facetable dataset fields defined in the installation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/edu/harvard/iq/dataverse/api/DatasetFields.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package edu.harvard.iq.dataverse.api; | ||
|
||
import edu.harvard.iq.dataverse.DatasetFieldServiceBean; | ||
import edu.harvard.iq.dataverse.DatasetFieldType; | ||
import jakarta.ejb.EJB; | ||
import jakarta.ws.rs.*; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import java.util.List; | ||
|
||
import static edu.harvard.iq.dataverse.util.json.JsonPrinter.jsonDatasetFieldTypes; | ||
|
||
/** | ||
* Api bean for managing dataset fields. | ||
*/ | ||
@Path("datasetfields") | ||
@Produces("application/json") | ||
public class DatasetFields extends AbstractApiBean { | ||
|
||
@EJB | ||
DatasetFieldServiceBean datasetFieldService; | ||
|
||
@GET | ||
@Path("facetables") | ||
public Response listAllFacetableDatasetFields() { | ||
List<DatasetFieldType> datasetFieldTypes = datasetFieldService.findAllFacetableFieldTypes(); | ||
return ok(jsonDatasetFieldTypes(datasetFieldTypes)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.