public void generateForm(FormRepresentation form, final String language,
Map<String, Object> inputs) {
Resource resource = new Resource(URLBuilder.generateFormURL(this.contextPath, language));
try {
String xml = helper.asXml(form, inputs);
resource.post().header(Resource.HEADER_ACCEPT, Resource.CONTENT_TYPE_TEXT).
xml(XMLParser.parse(xml)).send(new SimpleTextCallback(i18n.CouldntPreviewForm()) {
@Override
public void onSuccess(Method method, String urlResponse) {
bus.fireEvent(new PreviewFormResponseEvent(urlResponse, language));
}