use of com.peterphi.std.guice.web.rest.templating.TemplateCall in project stdlib by petergeneric.
the class ServiceUIServiceImpl method getList.
@Override
@Transactional(readOnly = true)
public String getList(final UriInfo query) {
final ConstrainedResultSet<OAuthServiceEntity> resultset = dao.findByUriQuery(new WebQuery().decode(query.getQueryParameters()));
final TemplateCall call = templater.template("services");
call.set("nonce", nonceStore.getValue(NONCE_USE));
call.set("resultset", resultset);
call.set("entities", resultset.getList());
return call.process();
}
use of com.peterphi.std.guice.web.rest.templating.TemplateCall in project stdlib by petergeneric.
the class ServiceUIServiceImpl method get.
@Override
@Transactional(readOnly = true)
public String get(final String id) {
final OAuthServiceEntity entity = dao.getById(id);
if (entity == null)
throw new IllegalArgumentException("No such service with client_id: " + id);
final TemplateCall call = templater.template("service");
call.set("nonce", nonceStore.getValue(NONCE_USE));
call.set("entity", entity);
call.set("localEndpoint", localEndpoint);
return call.process();
}
use of com.peterphi.std.guice.web.rest.templating.TemplateCall in project stdlib by petergeneric.
the class UserUIServiceImpl method getUsers.
@Override
@Transactional(readOnly = true)
@AuthConstraint(role = UserLogin.ROLE_ADMIN)
public String getUsers(UriInfo query) {
ConstrainedResultSet<UserEntity> resultset = accountDao.findByUriQuery(new WebQuery().orderAsc("id").decode(query));
TemplateCall call = templater.template("users");
call.set("resultset", resultset);
call.set("users", resultset.getList());
call.set("nonce", nonceStore.getValue(NONCE_USE));
return call.process();
}
Aggregations