use of org.activityinfo.server.endpoint.odk.build.XFormBuilder in project activityinfo by bedatadriven.
the class XFormResources method form.
@GET
@Path("{id}/xform")
@Produces(MediaType.TEXT_XML)
public Response form(@PathParam("id") int id) {
AuthenticatedUser user = authProvider.get();
LOGGER.finer("ODK activity form " + id + " requested by " + user.getEmail() + " (" + user.getId() + ")");
FormClass formClass = fetchFormClass(id);
String authenticationToken = authenticationTokenService.createAuthenticationToken(user.getId(), formClass.getId());
XForm xForm = new XFormBuilder(factory).setUserId(authenticationToken).build(formClass);
return Response.ok(xForm).build();
}
Aggregations