use of org.mycore.pi.frontend.model.MCRPIListJSON in project mycore by MyCoRe-Org.
the class MCRPersistentIdentifierRegistrationResource method listByType.
@GET
@Path("type/{type}")
@Produces(MediaType.APPLICATION_JSON)
public Response listByType(@PathParam("type") String type, @DefaultValue("0") @QueryParam("from") int from, @DefaultValue("50") @QueryParam("size") int size) {
Response errorResponse = validateParameters(from, size);
if (errorResponse != null)
return errorResponse;
List<MCRPIRegistrationInfo> mcrpiRegistrationInfos = MCRPersistentIdentifierManager.getInstance().getList(type, from, size);
return Response.status(Response.Status.OK).entity(new Gson().toJson(new MCRPIListJSON(type, from, size, MCRPersistentIdentifierManager.getInstance().getCount(type), mcrpiRegistrationInfos))).build();
}
use of org.mycore.pi.frontend.model.MCRPIListJSON in project mycore by MyCoRe-Org.
the class MCRPersistentIdentifierRegistrationResource method list.
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response list(@DefaultValue("0") @QueryParam("from") int from, @DefaultValue("50") @QueryParam("size") int size) {
Response errorResponse = validateParameters(from, size);
if (errorResponse != null)
return errorResponse;
List<MCRPIRegistrationInfo> mcrpiRegistrationInfos = MCRPersistentIdentifierManager.getInstance().getList(from, size);
return Response.status(Response.Status.OK).entity(new Gson().toJson(new MCRPIListJSON(null, from, size, MCRPersistentIdentifierManager.getInstance().getCount(), mcrpiRegistrationInfos))).build();
}
Aggregations