2012-04-07 12:45:35 -03:00
|
|
|
/*
|
2022-03-17 18:47:34 -03:00
|
|
|
* Copyright [2022] [wisemapping]
|
2012-04-07 12:45:35 -03:00
|
|
|
*
|
|
|
|
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
|
|
|
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
|
|
|
* "powered by wisemapping" text requirement on every single page;
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the license at
|
|
|
|
*
|
|
|
|
* http://www.wisemapping.org/license
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2012-02-17 10:42:20 -03:00
|
|
|
package com.wisemapping.rest;
|
|
|
|
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
import org.springframework.stereotype.Controller;
|
2021-12-24 18:03:23 -08:00
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
2012-02-17 10:42:20 -03:00
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@Controller
|
2012-02-21 20:04:17 -03:00
|
|
|
public class TransformerController extends BaseController {
|
2012-02-17 10:42:20 -03:00
|
|
|
|
2022-01-03 16:49:28 -08:00
|
|
|
@RequestMapping(method = RequestMethod.POST, value = "/transform", produces = {"application/freemind"}, consumes = {"application/xml"})
|
2012-02-17 10:42:20 -03:00
|
|
|
@ResponseBody
|
|
|
|
public ModelAndView transformFreemind(@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("transformViewFreemind", values);
|
|
|
|
}
|
|
|
|
}
|