MultivaluedMap<String, String> pathp = ctx.getUriInfo().getPathParameters();
String id = pathp.getFirst(Config._ID);
String type = pathp.getFirst(Config._TYPE);
String id2 = pathp.getFirst("id2");
String type2 = pathp.getFirst("type2");
App app = RestUtils.getPrincipalApp();
String typeSingular = (type == null) ? null : RestUtils.getAllTypes(app).get(type);
type = (typeSingular == null) ? type : typeSingular;
id2 = StringUtils.isBlank(id2) ? params.getFirst(Config._ID) : id2;
type2 = StringUtils.isBlank(type2) ? params.getFirst(Config._TYPE) : type2;
ParaObject pobj = Utils.toObject(type);
pobj.setId(id);
pobj = dao.read(app.getAppIdentifier(), pobj.getId());
Pager pager = new Pager();
pager.setPage(NumberUtils.toLong(params.getFirst("page"), 0));
pager.setSortby(params.getFirst("sort"));
pager.setDesc(Boolean.parseBoolean(params.containsKey("desc") ? params.getFirst("desc") : "true"));