From a618849afcc7706661928372940c86fadf1a32f0 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 2 Apr 2022 12:59:54 -0300 Subject: [PATCH] Remove REST API application/xml type support --- .../wisemapping/rest/AccountController.java | 2 +- .../com/wisemapping/rest/AdminController.java | 6 +-- .../com/wisemapping/rest/LabelController.java | 4 +- .../wisemapping/rest/MindmapController.java | 30 ++++++------ .../rest/TransformerController.java | 46 ------------------- .../com/wisemapping/rest/UserController.java | 4 +- .../rest/model/RestCollaboration.java | 6 --- .../rest/model/RestCollaborationList.java | 7 --- .../rest/model/RestCollaborator.java | 2 - .../wisemapping/rest/model/RestErrors.java | 2 - .../com/wisemapping/rest/model/RestLabel.java | 6 --- .../wisemapping/rest/model/RestLabelList.java | 5 -- .../wisemapping/rest/model/RestLockInfo.java | 7 --- .../wisemapping/rest/model/RestLogItem.java | 6 --- .../wisemapping/rest/model/RestMindmap.java | 2 - .../rest/model/RestMindmapHistory.java | 5 -- .../rest/model/RestMindmapHistoryList.java | 7 --- .../rest/model/RestMindmapInfo.java | 6 --- .../rest/model/RestMindmapList.java | 2 - .../com/wisemapping/rest/model/RestUser.java | 5 -- .../rest/model/RestUserRegistration.java | 7 --- .../main/webapp/WEB-INF/wisemapping-rest.xml | 22 --------- .../com/wisemapping/test/rest/RestHelper.java | 2 +- .../test/rest/RestMindmapITCase.java | 10 +--- 24 files changed, 25 insertions(+), 176 deletions(-) delete mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java index b56605b4..0d6acbd0 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -68,7 +68,7 @@ public class AccountController extends BaseController { userService.changePassword(user); } - @RequestMapping(method = RequestMethod.GET, value = "/account", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/account", produces = {"application/json"}) public RestUser fetchAccount() { final User user = Utils.getUser(true); return new RestUser(user); diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java index c8e8deb2..ca516dda 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -50,7 +50,7 @@ public class AdminController extends BaseController { @Autowired private MindmapService mindmapService; - @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json"}) @ResponseBody public RestUser getUserById(@PathVariable int id) throws IOException { final User userBy = userService.getUserBy(id); @@ -60,7 +60,7 @@ public class AdminController extends BaseController { return new RestUser(userBy); } - @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email:.+}", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email:.+}", produces = {"application/json"}) @ResponseBody public RestUser getUserByEmail(@PathVariable String email) throws IOException { final User user = userService.getUserBy(email); @@ -70,7 +70,7 @@ public class AdminController extends BaseController { return new RestUser(user); } - @RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = { "application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.CREATED) public void createUser(@RequestBody RestUser user, HttpServletResponse response) throws WiseMappingException { if (user == null) { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/LabelController.java b/wise-webapp/src/main/java/com/wisemapping/rest/LabelController.java index c4ec9117..7b801bb7 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/LabelController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/LabelController.java @@ -46,7 +46,7 @@ public class LabelController extends BaseController { private LabelService labelService; - @RequestMapping(method = RequestMethod.POST, value = "/labels", consumes = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.POST, value = "/labels", consumes = {"application/json"}) @ResponseStatus(value = HttpStatus.CREATED) public void createLabel(@RequestBody RestLabel restLabel, @NotNull HttpServletResponse response, @RequestParam(required = false) String title) throws WiseMappingException { // Overwrite title if it was specified by parameter. @@ -64,7 +64,7 @@ public class LabelController extends BaseController { response.setHeader("ResourceId", Long.toString(label.getId())); } - @RequestMapping(method = RequestMethod.GET, value = "/labels", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/labels", produces = {"application/json"}) public RestLabelList retrieveList() { final User user = Utils.getUser(); assert user != null; diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java index c64c3b9e..c59eb0f2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -58,7 +58,7 @@ public class MindmapController extends BaseController { @Autowired private LabelService labelService; - @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "application/xml", "text/html"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json"}) @ResponseBody public RestMindmap retrieve(@PathVariable int id) throws WiseMappingException { final User user = Utils.getUser(); @@ -66,7 +66,7 @@ public class MindmapController extends BaseController { return new RestMindmap(mindMap, user); } - @RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json"}) public RestMindmapList retrieveList(@RequestParam(required = false) String q) throws IOException { final User user = Utils.getUser(); @@ -80,7 +80,7 @@ public class MindmapController extends BaseController { return new RestMindmapList(mindmaps, user); } - @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history/", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history/", produces = {"application/json"}) public RestMindmapHistoryList fetchHistory(@PathVariable int id) { final List histories = mindmapService.findMindmapHistory(id); final RestMindmapHistoryList result = new RestMindmapHistoryList(); @@ -109,7 +109,7 @@ public class MindmapController extends BaseController { } } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateDocument(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws WiseMappingException, IOException { @@ -169,7 +169,7 @@ public class MindmapController extends BaseController { /** * The intention of this method is the update of several properties at once ... */ - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = { "application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateProperties(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException { @@ -223,7 +223,7 @@ public class MindmapController extends BaseController { return result; } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateTitle(@RequestBody String title, @PathVariable int id) throws WiseMappingException { @@ -241,7 +241,7 @@ public class MindmapController extends BaseController { mindmapService.updateMindmap(mindMap, false); } - @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}/collabs/", consumes = {"application/json", "application/xml"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}/collabs/", consumes = {"application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateCollabs(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException, MapCouldNotFoundException, AccessDeniedSecurityException, InvalidEmailException { final Mindmap mindMap = findMindmapById(id); @@ -288,7 +288,7 @@ public class MindmapController extends BaseController { } } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs/", consumes = {"application/json", "application/xml"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs/", consumes = {"application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void addCollab(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException, MapCouldNotFoundException, AccessDeniedSecurityException, InvalidEmailException { final Mindmap mindMap = findMindmapById(id); @@ -351,7 +351,7 @@ public class MindmapController extends BaseController { } - @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json"}) public RestCollaborationList retrieveList(@PathVariable int id) throws MapCouldNotFoundException, AccessDeniedSecurityException { final Mindmap mindMap = findMindmapById(id); @@ -367,7 +367,7 @@ public class MindmapController extends BaseController { return result; } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateDescription(@RequestBody String description, @PathVariable int id) throws WiseMappingException { final Mindmap mindmap = findMindmapById(id); @@ -375,7 +375,7 @@ public class MindmapController extends BaseController { mindmapService.updateMindmap(mindmap, false); } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updatePublishState(@RequestBody String value, @PathVariable int id) throws WiseMappingException { @@ -431,7 +431,7 @@ public class MindmapController extends BaseController { } } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateStarredState(@RequestBody String value, @PathVariable int id) throws WiseMappingException { @@ -503,7 +503,7 @@ public class MindmapController extends BaseController { response.setHeader("ResourceId", Integer.toString(mindmap.getId())); } - @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/xml", "application/json", "text/plain"}) + @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/json"}, produces = { "application/json", "text/plain"}) @ResponseStatus(value = HttpStatus.CREATED) public void createDuplicate(@RequestBody RestMindmapInfo restMindmap, @PathVariable int id, @NotNull HttpServletResponse response) throws IOException, WiseMappingException { // Validate ... @@ -558,7 +558,7 @@ public class MindmapController extends BaseController { mindmapService.updateMindmap(mindmap, false); } - @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}/labels", consumes = {"application/xml", "application/json"}) + @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}/labels", consumes = {"application/json"}) @ResponseStatus(value = HttpStatus.OK) public void updateLabel(@PathVariable int id, @RequestBody int lid) throws WiseMappingException { final User user = Utils.getUser(); @@ -572,7 +572,7 @@ public class MindmapController extends BaseController { mindmapService.updateMindmap(mindmap, false); } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json"}) public ResponseEntity lockMindmap(@RequestBody String value, @PathVariable int id) throws WiseMappingException { final User user = Utils.getUser(); final LockManager lockManager = mindmapService.getLockManager(); diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java b/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java deleted file mode 100644 index 62d4b2c5..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java +++ /dev/null @@ -1,46 +0,0 @@ -/* -* Copyright [2022] [wisemapping] -* -* 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. -*/ - -package com.wisemapping.rest; - -import org.jetbrains.annotations.Nullable; -import org.springframework.stereotype.Controller; -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; -import org.springframework.web.servlet.ModelAndView; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -@Controller -public class TransformerController extends BaseController { - - @RequestMapping(method = RequestMethod.POST, value = "/transform", produces = {"application/freemind"}, consumes = {"application/xml"}) - @ResponseBody - public ModelAndView transformFreemind(@RequestBody @Nullable final String content) throws IOException { - final Map values = new HashMap(); - if (content == null || content.length() == 0) { - throw new IllegalArgumentException("Body can not be null."); - } - values.put("content", content); - return new ModelAndView("transformViewFreemind", values); - } -} diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java b/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java index 76dbe9f5..64260877 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java @@ -55,7 +55,7 @@ public class UserController extends BaseController { private static final Logger logger = Logger.getLogger(UserController.class); private static final String REAL_IP_ADDRESS_HEADER = "X-Real-IP"; - @RequestMapping(method = RequestMethod.POST, value = "/users", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.POST, value = "/users", produces = {"application/json"}) @ResponseStatus(value = HttpStatus.CREATED) public void registerUser(@RequestBody RestUserRegistration registration, @NotNull HttpServletRequest request, @NotNull HttpServletResponse response) throws WiseMappingException, BindException { logger.debug("Register new user:" + registration.getEmail()); @@ -80,7 +80,7 @@ public class UserController extends BaseController { response.setHeader("Location", "/service/users/" + user.getId()); } - @RequestMapping(method = RequestMethod.PUT, value = "/users/resetPassword", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/users/resetPassword", produces = {"application/json"}) @ResponseStatus(value = HttpStatus.OK) public void resetPassword(@RequestParam String email) throws InvalidAuthSchemaException, EmailNotExistsException { try { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java index 8abbc2d7..34f3691b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java @@ -24,12 +24,6 @@ import com.wisemapping.model.Collaboration; import com.wisemapping.model.CollaborationRole; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "collaboration") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborationList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborationList.java index 37b26d47..ad9b7af9 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborationList.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborationList.java @@ -22,15 +22,9 @@ package com.wisemapping.rest.model; import com.fasterxml.jackson.annotation.JsonAutoDetect; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; -@XmlRootElement(name = "collaborations") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, @@ -52,7 +46,6 @@ public class RestCollaborationList { } - @XmlElement(name = "collaborations") public List getCollaborations() { return collaborations; } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborator.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborator.java index ec876ce1..1593af01 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborator.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborator.java @@ -29,8 +29,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import java.util.Calendar; -@XmlRootElement(name = "collaborator") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestErrors.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestErrors.java index e156b63c..daf4a213 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestErrors.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestErrors.java @@ -35,8 +35,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import java.util.*; -@XmlRootElement(name = "errors") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java index 159061fa..416d72f2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java @@ -7,15 +7,9 @@ import com.wisemapping.model.Label; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; -@XmlRootElement(name = "label") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = NONE, setterVisibility = PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabelList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabelList.java index 0c03bfdb..10f7f8f4 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabelList.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabelList.java @@ -4,15 +4,10 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.wisemapping.model.Label; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; -@XmlRootElement(name = "labels") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLockInfo.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLockInfo.java index 7da4b783..ad1d6a88 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLockInfo.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLockInfo.java @@ -21,18 +21,11 @@ package com.wisemapping.rest.model; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.wisemapping.model.Collaborator; import com.wisemapping.model.User; import com.wisemapping.service.LockInfo; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "lock") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLogItem.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLogItem.java index 5894962c..3500d843 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLogItem.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLogItem.java @@ -22,12 +22,6 @@ package com.wisemapping.rest.model; import com.fasterxml.jackson.annotation.JsonAutoDetect; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "logitem") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java index 98a74342..660fbb28 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java @@ -35,8 +35,6 @@ import javax.xml.bind.annotation.XmlRootElement; import java.io.IOException; import java.util.Calendar; -@XmlRootElement(name = "map") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java index cd464824..bcf4efb2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java @@ -25,16 +25,11 @@ import com.wisemapping.model.MindMapHistory; import com.wisemapping.model.User; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; -@XmlRootElement(name = "history") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistoryList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistoryList.java index cfb9e3b6..dac1efeb 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistoryList.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistoryList.java @@ -22,15 +22,9 @@ package com.wisemapping.rest.model; import com.fasterxml.jackson.annotation.JsonAutoDetect; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; -@XmlRootElement(name = "history") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, @@ -51,7 +45,6 @@ public class RestMindmapHistoryList { } - @XmlElement(name = "changes") public List getChanges() { return changes; } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java index fc13611b..c919a917 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java @@ -28,17 +28,11 @@ import com.wisemapping.util.TimeUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; import java.util.Calendar; -import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -@XmlRootElement(name = "mapinfo") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java index f3b5179f..e2a642a8 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java @@ -33,8 +33,6 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -@XmlRootElement(name = "maps") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUser.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUser.java index 8cf64298..949d3aea 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUser.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUser.java @@ -26,14 +26,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.wisemapping.model.User; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; import java.util.Calendar; -@XmlRootElement(name = "user") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java index 9a9bc750..dca77ea3 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java @@ -24,13 +24,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.wisemapping.model.User; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - - -@XmlRootElement(name = "user") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml index 3999bb07..913667ce 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml @@ -22,25 +22,6 @@ - - - - com.wisemapping.rest.model.RestMindmap - com.wisemapping.rest.model.RestMindmapInfo - com.wisemapping.rest.model.RestMindmapList - com.wisemapping.rest.model.RestUser - com.wisemapping.rest.model.RestErrors - com.wisemapping.rest.model.RestCollaboration - com.wisemapping.rest.model.RestCollaborationList - com.wisemapping.rest.model.RestLogItem - com.wisemapping.rest.model.RestLockInfo - com.wisemapping.rest.model.RestLabel - com.wisemapping.rest.model.RestLabelList - com.wisemapping.rest.model.RestUserRegistration - - - - @@ -66,9 +47,6 @@ - - - diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestHelper.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestHelper.java index 7430e5a4..2209b1ad 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestHelper.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestHelper.java @@ -46,7 +46,7 @@ public class RestHelper { @DataProvider(name = "ContentType-Provider-Function") static Object[][] contentTypes() { - return new Object[][]{{MediaType.APPLICATION_XML}, {MediaType.APPLICATION_JSON}}; + return new Object[][]{{MediaType.APPLICATION_JSON}}; } } diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java index bc6cf281..b87d3c30 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java @@ -201,10 +201,6 @@ public class RestMindmapITCase { @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") public void updateMap(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... - if (MediaType.APPLICATION_XML == mediaType) { - throw new SkipException("Some research need to check why it's falling."); - } - final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); @@ -223,7 +219,7 @@ public class RestMindmapITCase { // Update map ... final String resourceUrl = HOST_PORT + resourceUri.toString() + "/document"; - requestHeaders.setContentType(MediaType.APPLICATION_XML); + requestHeaders.setContentType(MediaType.APPLICATION_JSON); final HttpEntity updateEntity = new HttpEntity<>(mapToUpdate, requestHeaders); template.put(resourceUrl, updateEntity); @@ -396,10 +392,6 @@ public class RestMindmapITCase { @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") public void addLabelToMindmap(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... - if (MediaType.APPLICATION_XML == mediaType) { - throw new SkipException("Some research need to check why it's falling."); - } - final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail);