private FormPreviewDTO createFormPreviewDTO(FormRepresentation form) throws Exception {
FormPreviewDTO dto = new FormPreviewDTO();
String jsonBody = FormEncodingFactory.getEncoder().encode(form);
dto.setRepresentation(jsonBody);
List<FormPreviewParameterDTO> inputs = new ArrayList<FormPreviewParameterDTO>();
FormPreviewParameterDTO param1 = new FormPreviewParameterDTO();
param1.setKey("key1");
param1.setValue("value1");
FormPreviewParameterDTO param2 = new FormPreviewParameterDTO();
param2.setKey("key2");
param2.setValue("value2");
inputs.add(param1);
inputs.add(param2);
dto.setInput(inputs);
return dto;
}