Package nl.knaw.dans.lib.dataverse
Class MetadataBlocksApi
java.lang.Object
nl.knaw.dans.lib.dataverse.MetadataBlocksApi
Metadata blocks API end-points.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final nl.knaw.dans.lib.dataverse.HttpClientWrapperprotected static final String -
Method Summary
Modifier and TypeMethodDescriptionprotected PathgetMetadataBlock(int id) Retrieves metadata block information by its integer ID.getMetadataBlock(long id) Retrieves metadata block information by its long ID.getMetadataBlock(String identifier) Retrieves metadata block information by its identifier (name or ID).getQueryParamsFromMetadataKeys(Map<String, String> metadataKeys) Retrieves a list of all metadata blocks.listMetadataBlocks(boolean onlyDisplayedOnCreate) Retrieves a list of all metadata blocks with an option to filter only those displayed on create.listMetadataBlocks(boolean onlyDisplayedOnCreate, boolean returnDatasetFieldTypes) Retrieves a list of all metadata blocks with options to filter only those displayed on create and to return dataset field types.toString()
-
Field Details
-
MDKEY_PARAM_NAME_PREFIX
- See Also:
-
httpClientWrapper
protected final nl.knaw.dans.lib.dataverse.HttpClientWrapper httpClientWrapper
-
-
Method Details
-
listMetadataBlocks
public DataverseHttpResponse<List<MetadataBlockDefinition>> listMetadataBlocks() throws IOException, DataverseExceptionRetrieves a list of all metadata blocks.- Returns:
- a list of metadata blocks
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
listMetadataBlocks
public DataverseHttpResponse<List<MetadataBlockDefinition>> listMetadataBlocks(boolean onlyDisplayedOnCreate) throws IOException, DataverseException Retrieves a list of all metadata blocks with an option to filter only those displayed on create.- Parameters:
onlyDisplayedOnCreate- whether to return only metadata blocks displayed on create- Returns:
- a list of metadata blocks
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
listMetadataBlocks
public DataverseHttpResponse<List<MetadataBlockDefinition>> listMetadataBlocks(boolean onlyDisplayedOnCreate, boolean returnDatasetFieldTypes) throws IOException, DataverseException Retrieves a list of all metadata blocks with options to filter only those displayed on create and to return dataset field types.- Parameters:
onlyDisplayedOnCreate- whether to return only metadata blocks displayed on createreturnDatasetFieldTypes- whether to include dataset field types- Returns:
- a list of metadata blocks
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
getMetadataBlock
public DataverseHttpResponse<MetadataBlockDefinition> getMetadataBlock(String identifier) throws IOException, DataverseException Retrieves metadata block information by its identifier (name or ID).- Parameters:
identifier- the metadata block identifier (name or ID)- Returns:
- the metadata block
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
getMetadataBlock
public DataverseHttpResponse<MetadataBlockDefinition> getMetadataBlock(int id) throws IOException, DataverseException Retrieves metadata block information by its integer ID.- Parameters:
id- the metadata block ID- Returns:
- the metadata block
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
getMetadataBlock
public DataverseHttpResponse<MetadataBlockDefinition> getMetadataBlock(long id) throws IOException, DataverseException Retrieves metadata block information by its long ID.- Parameters:
id- the metadata block ID- Returns:
- the metadata block
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
toString
-
buildPath
-
getQueryParamsFromMetadataKeys
-