@QueryParam("max") @DefaultValue("10") int max,
@QueryParam("source") @DefaultValue("self") String source,
@QueryParam("orderBy") @DefaultValue("dateadded") String orderBy,
@QueryParam("desc") @DefaultValue("1") int desc)
{
PersistenceService persistenceSvc = PersistenceService.getInstance();
try {
persistenceSvc.beginTx();
return new WeightsConverter(
getEntities(start, max, source, orderBy, desc),
uriInfo.getAbsolutePath(),
Api.DEFAULT_EXPAND_LEVEL
);
} finally {
persistenceSvc.commitTx();
persistenceSvc.close();
}
}