use of edu.harvard.iq.dataverse.engine.command.impl.ListMetadataBlocksCommand in project dataverse by IQSS.
the class Dataverses method listMetadataBlocks.
@GET
@Path("{identifier}/metadatablocks")
public Response listMetadataBlocks(@PathParam("identifier") String dvIdtf) {
try {
JsonArrayBuilder arr = Json.createArrayBuilder();
final List<MetadataBlock> blocks = execCommand(new ListMetadataBlocksCommand(createDataverseRequest(findUserOrDie()), findDataverseOrDie(dvIdtf)));
for (MetadataBlock mdb : blocks) {
arr.add(brief.json(mdb));
}
return allowCors(ok(arr));
} catch (WrappedResponse we) {
return we.getResponse();
}
}
Aggregations