Search in sources :

Example 1 with XFormBuilder

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();
}
Also used : XForm(org.activityinfo.io.xform.form.XForm) FormClass(org.activityinfo.model.form.FormClass) XFormBuilder(org.activityinfo.server.endpoint.odk.build.XFormBuilder) AuthenticatedUser(org.activityinfo.legacy.shared.AuthenticatedUser)

Aggregations

XForm (org.activityinfo.io.xform.form.XForm)1 AuthenticatedUser (org.activityinfo.legacy.shared.AuthenticatedUser)1 FormClass (org.activityinfo.model.form.FormClass)1 XFormBuilder (org.activityinfo.server.endpoint.odk.build.XFormBuilder)1