Add support for Freemind to Wise transformation:

curl http://localhost:8080/service/transform.wise --data @fonts.mm  -H "Content-Type:application/freemind" --post301
This commit is contained in:
Paulo Gustavo Veiga
2012-02-29 20:22:27 -03:00
parent f704e730c9
commit 9f4c928d13
6 changed files with 83 additions and 17 deletions

View File

@@ -81,6 +81,18 @@ public class TransformerController extends BaseController {
return new ModelAndView("transformViewFreemind", values);
}
@RequestMapping(method = RequestMethod.POST, value = "/transform", produces = {"application/wisemapping+xml"}, consumes = {"application/freemind"})
@ResponseBody
public ModelAndView transformWisemapping(@RequestBody @Nullable final String content) throws IOException {
final Map<String, Object> values = new HashMap<String, Object>();
if (content == null || content.length() == 0) {
throw new IllegalArgumentException("Body can not be null.");
}
values.put("content", content);
return new ModelAndView("transformViewWise", values);
}
@RequestMapping(method = RequestMethod.POST, value = "/transform", consumes = {"application/x-www-form-urlencoded"})
public ModelAndView transform(@NotNull HttpServletRequest request,
@NotNull HttpServletResponse response) throws IOException {