From 4e45aea3f9a0ddf373476dd6a20c727587787361 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 8 Feb 2022 17:43:47 -0800 Subject: [PATCH 1/5] Bump up version --- pom.xml | 4 ++-- wise-ui/pom.xml | 2 +- wise-webapp/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f67ac945..8ce6d270 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 5.0.2-SNAPSHOT + 5.0.3-SNAPSHOT ${project.basedir}/wise-webapps @@ -16,7 +16,7 @@ org.wisemapping wisemapping WiseMapping Project - 5.0.2-SNAPSHOT + 5.0.3-SNAPSHOT pom diff --git a/wise-ui/pom.xml b/wise-ui/pom.xml index 42311f87..e700437d 100644 --- a/wise-ui/pom.xml +++ b/wise-ui/pom.xml @@ -12,7 +12,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.2-SNAPSHOT + 5.0.3-SNAPSHOT diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index a7bde32a..2dda52b4 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.2-SNAPSHOT + 5.0.3-SNAPSHOT From 62e009b7e49d66bae9156932bba2d6b00fb76245 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 9 Feb 2022 14:17:28 -0800 Subject: [PATCH 2/5] Fix add label. --- .../src/main/java/com/wisemapping/rest/MindmapController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 fcfdb8de..6b9f8f30 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -580,7 +580,7 @@ public class MindmapController extends BaseController { @RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}/labels/{lid)}") @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void removeLabelFromMap(@PathVariable int id, @RequestBody int lid) throws WiseMappingException { + public void removeLabelFromMap(@PathVariable int id, @PathVariable int lid) throws WiseMappingException { final User user = Utils.getUser(); final Mindmap mindmap = findMindmapById(id); final Label label = labelService.findLabelById(lid, user); From 571895a2b3644fd43d65d5d1a60062c45a794b37 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 9 Feb 2022 16:49:48 -0800 Subject: [PATCH 3/5] Fix label delete --- .../wisemapping/rest/MindmapController.java | 18 ++++++++---------- .../src/main/webapp/jsp/mindmapEditor.jsp | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) 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 6b9f8f30..a9317185 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -74,7 +74,7 @@ public class MindmapController extends BaseController { List mindmaps = mindmapService.findMindmapsByUser(user); mindmaps = mindmaps .stream() - .filter(m->filter.accept(m, user)) + .filter(m -> filter.accept(m, user)) .collect(Collectors.toUnmodifiableList()); return new RestMindmapList(mindmaps, user); @@ -496,7 +496,7 @@ public class MindmapController extends BaseController { } } - @RequestMapping(method = RequestMethod.POST, value = "/maps", consumes = {"application/xml", "application/json", "application/wisemapping+xml"}) + @RequestMapping(method = RequestMethod.POST, value = "/maps", consumes = {"application/xml", "application/json"}) @ResponseStatus(value = HttpStatus.CREATED) public void createMap(@RequestBody(required = false) RestMindmap restMindmap, @NotNull HttpServletResponse response, @RequestParam(required = false) String title, @RequestParam(required = false) String description) throws IOException, WiseMappingException { // If a default maps has not been defined, just create one ... @@ -508,11 +508,9 @@ public class MindmapController extends BaseController { if (title != null && !title.isEmpty()) { restMindmap.setTitle(title); } - if (description != null && !description.isEmpty()) { - restMindmap.setDescription(description); - } else { - restMindmap.setDescription(""); - } + + description = description != null && !description.isEmpty() ? description : ""; + restMindmap.setDescription(description); // Validate ... final BindingResult result = new BeanPropertyBindingResult(restMindmap, ""); @@ -578,7 +576,7 @@ public class MindmapController extends BaseController { return new ValidationException(result); } - @RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}/labels/{lid)}") + @RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}/labels/{lid}") @ResponseStatus(value = HttpStatus.NO_CONTENT) public void removeLabelFromMap(@PathVariable int id, @PathVariable int lid) throws WiseMappingException { final User user = Utils.getUser(); @@ -590,7 +588,7 @@ public class MindmapController extends BaseController { } mindmap.removeLabel(label); - mindmapService.updateMindmap(mindmap,false); + mindmapService.updateMindmap(mindmap, false); } @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}/labels", consumes = {"application/xml", "application/json"}) @@ -604,6 +602,6 @@ public class MindmapController extends BaseController { final Mindmap mindmap = findMindmapById(id); mindmap.addLabel(label); - mindmapService.updateMindmap(mindmap,false); + mindmapService.updateMindmap(mindmap, false); } } diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index e084b230..95a67fec 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -38,7 +38,6 @@ var readOnly = ${readOnlyMode}; var lockTimestamp = '${lockTimestamp}'; var lockSession = '${lockSession}'; - var locale = '${locale}'; var mindmapLocked = ${mindmapLocked}; var mindmapLockedMsg = ''; var userOptions = ${mindmap.properties}; From 6abc5a9e5e7d4c2f4715e94ca09ee8cfb6ada64f Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 9 Feb 2022 19:13:09 -0800 Subject: [PATCH 4/5] Fix map creation url --- .../wisemapping/rest/MindmapController.java | 36 +++---- .../test/rest/RestMindmapITCase.java | 98 +++++++++---------- 2 files changed, 60 insertions(+), 74 deletions(-) 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 a9317185..65e7a05e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -495,45 +495,41 @@ public class MindmapController extends BaseController { mindmapService.removeMindmap(mindmap, user); } } - @RequestMapping(method = RequestMethod.POST, value = "/maps", consumes = {"application/xml", "application/json"}) @ResponseStatus(value = HttpStatus.CREATED) - public void createMap(@RequestBody(required = false) RestMindmap restMindmap, @NotNull HttpServletResponse response, @RequestParam(required = false) String title, @RequestParam(required = false) String description) throws IOException, WiseMappingException { - // If a default maps has not been defined, just create one ... - if (restMindmap == null) { - restMindmap = new RestMindmap(); - } + public void createMap(@RequestBody(required = false) String mapXml, @NotNull HttpServletResponse response, @RequestParam(required = false) String title, @RequestParam(required = false) String description) throws IOException, WiseMappingException { - // Overwrite title and description if they where specified by parameter. + final Mindmap mindmap = new Mindmap(); if (title != null && !title.isEmpty()) { - restMindmap.setTitle(title); + mindmap.setTitle(title); } - description = description != null && !description.isEmpty() ? description : ""; - restMindmap.setDescription(description); + if (description != null && !description.isEmpty()) { + mindmap.setDescription(description); + }else { + mindmap.setDescription("description"); + } // Validate ... - final BindingResult result = new BeanPropertyBindingResult(restMindmap, ""); - new MapInfoValidator(mindmapService).validate(restMindmap.getDelegated(), result); + final BindingResult result = new BeanPropertyBindingResult(mindmap, ""); + new MapInfoValidator(mindmapService).validate(mindmap, result); if (result.hasErrors()) { throw new ValidationException(result); } // If the user has not specified the xml content, add one ... - final Mindmap delegated = restMindmap.getDelegated(); - String xml = restMindmap.getXml(); - if (xml == null || xml.isEmpty()) { - xml = Mindmap.getDefaultMindmapXml(restMindmap.getTitle()); + if (mapXml == null || mapXml.isEmpty()) { + mapXml = Mindmap.getDefaultMindmapXml(mindmap.getTitle()); } - delegated.setXmlStr(xml); + mindmap.setXmlStr(mapXml); // Add new mindmap ... final User user = Utils.getUser(); - mindmapService.addMindmap(delegated, user); + mindmapService.addMindmap(mindmap, user); // Return the new created map ... - response.setHeader("Location", "/service/maps/" + delegated.getId()); - response.setHeader("ResourceId", Integer.toString(delegated.getId())); + response.setHeader("Location", "/service/maps/" + mindmap.getId()); + 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"}) 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 46e745cd..fd8b418e 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 @@ -35,16 +35,16 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void listMaps(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void listMaps(final @NotNull MediaType mediaType) { // Configure media types ... final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... final String title1 = "List Maps 1 - " + mediaType; - addNewMap(requestHeaders, template, title1); + addNewMap(template, title1); final String title2 = "List Maps 2 - " + mediaType; - addNewMap(requestHeaders, template, title2); + addNewMap(template, title2); // Check that the map has been created ... final HttpEntity findMapEntity = new HttpEntity(requestHeaders); @@ -68,13 +68,13 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void deleteMap(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void deleteMap(final @NotNull MediaType mediaType) { // Configure media types ... final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... final String title1 = "Map to delete - " + mediaType; - final URI resourceUri = addNewMap(requestHeaders, template, title1); + final URI resourceUri = addNewMap(template, title1); // Now remove it ... template.delete(HOST_PORT + resourceUri.toString()); @@ -84,21 +84,22 @@ public class RestMindmapITCase { findMap(requestHeaders, template, resourceUri); fail("Map could not be removed:" + resourceUri); } catch (Exception e) { + // Ignore } } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void changeMapTitle(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void changeMapTitle(final @NotNull MediaType mediaType) { // Configure media types ... final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... - final URI resourceUri = addNewMap(requestHeaders, template, "Map to change title - " + mediaType); + final URI resourceUri = addNewMap(template, "Map to change title - " + mediaType); // Change map title ... requestHeaders.setContentType(MediaType.TEXT_PLAIN); final String newTitle = "New map to change title - " + mediaType; - final HttpEntity updateEntity = new HttpEntity(newTitle, requestHeaders); + final HttpEntity updateEntity = new HttpEntity<>(newTitle, requestHeaders); template.put(HOST_PORT + resourceUri + "/title", updateEntity); // Load map again .. @@ -107,22 +108,18 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void validateMapsCreation(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void validateMapsCreation(final @NotNull MediaType mediaType) { // Configure media types ... final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... final String title = "Map to Validate Creation - " + mediaType; - final URI resourceUri = addNewMap(requestHeaders, template, title); - - // Try to create a map with the same title .. - final RestMindmap restMindmap = new RestMindmap(); - restMindmap.setTitle(title); - restMindmap.setDescription("My Map Desc"); + addNewMap(template, title); + // Add map with same name ... try { - HttpEntity createUserEntity = new HttpEntity(restMindmap, requestHeaders); - template.postForLocation(BASE_REST_URL + "/maps", createUserEntity); + HttpEntity createUserEntity = new HttpEntity<>(requestHeaders); + template.postForLocation(BASE_REST_URL + "/maps?title=" + title, createUserEntity); } catch (HttpClientErrorException cause) { final String responseBodyAsString = cause.getResponseBodyAsString(); assert (responseBodyAsString.contains("You have already a map")); @@ -134,17 +131,17 @@ public class RestMindmapITCase { @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void changeMapDescription(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void changeMapDescription(final @NotNull MediaType mediaType) { // Configure media types ... final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... - final URI resourceUri = addNewMap(requestHeaders, template, "Map to change Description - " + mediaType); + final URI resourceUri = addNewMap(template, "Map to change Description - " + mediaType); // Change map title ... requestHeaders.setContentType(MediaType.TEXT_PLAIN); final String newDescription = "New map to change description - " + mediaType; - final HttpEntity updateEntity = new HttpEntity(newDescription, requestHeaders); + final HttpEntity updateEntity = new HttpEntity<>(newDescription, requestHeaders); template.put(HOST_PORT + resourceUri + "/description", updateEntity); // Load map again .. @@ -153,19 +150,19 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void updateMapXml(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void updateMapXml(final @NotNull MediaType mediaType) throws IOException { // Configure media types ... final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... final String title = "Update XML sample " + mediaType; - final URI resourceUri = addNewMap(requestHeaders, template, title); + final URI resourceUri = addNewMap(template, title); // Update map xml content ... final String resourceUrl = HOST_PORT + resourceUri.toString(); requestHeaders.setContentType(MediaType.TEXT_PLAIN); final String newXmlContent = "this is not valid"; - HttpEntity updateEntity = new HttpEntity(newXmlContent, requestHeaders); + HttpEntity updateEntity = new HttpEntity<>(newXmlContent, requestHeaders); template.put(resourceUrl + "/document/xml", updateEntity); // Check that the map has been updated ... @@ -174,14 +171,14 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void cloneMap(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void cloneMap(final @NotNull MediaType mediaType) throws IOException { // Configure media types ... final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... final String title = "Map to clone sample " + mediaType; final String xml = ""; - final URI newMapUri = addNewMap(requestHeaders, template, title, xml); + final URI newMapUri = addNewMap(template, title, xml); // Clone map ... final RestMindmapInfo restMindmap = new RestMindmapInfo(); @@ -189,7 +186,7 @@ public class RestMindmapITCase { restMindmap.setDescription("Cloned map desc"); // Create a new map ... - final HttpEntity cloneEntity = new HttpEntity(restMindmap, requestHeaders); + final HttpEntity cloneEntity = new HttpEntity<>(restMindmap, requestHeaders); final URI clonedMapUri = template.postForLocation(HOST_PORT + newMapUri, cloneEntity); // Check that the map has been updated ... @@ -198,7 +195,7 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void verifyMapOwnership(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void verifyMapOwnership(final @NotNull MediaType mediaType) { // Configure media types ... throw new SkipException("missing test: removeUserShouldOnlyDeleteOnwedMap"); } @@ -213,7 +210,7 @@ public class RestMindmapITCase { // Create a sample map ... final String title = "Update sample " + mediaType; - final URI resourceUri = addNewMap(requestHeaders, template, title); + final URI resourceUri = addNewMap(template, title); // Build map to update ... final RestMindmap mapToUpdate = new RestMindmap(); @@ -223,23 +220,23 @@ public class RestMindmapITCase { // Update map ... final String resourceUrl = HOST_PORT + resourceUri.toString() + "/document"; requestHeaders.setContentType(MediaType.APPLICATION_XML); - final HttpEntity updateEntity = new HttpEntity(mapToUpdate, requestHeaders); + final HttpEntity updateEntity = new HttpEntity<>(mapToUpdate, requestHeaders); template.put(resourceUrl, updateEntity); // Check that the map has been updated ... - HttpEntity findMapEntity = new HttpEntity(requestHeaders); + HttpEntity findMapEntity = new HttpEntity<>(requestHeaders); final ResponseEntity response = template.exchange(HOST_PORT + resourceUri, HttpMethod.GET, findMapEntity, RestMindmap.class); assertEquals(response.getBody().getXml(), mapToUpdate.getXml()); assertEquals(response.getBody().getProperties(), mapToUpdate.getProperties()); } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void addCollabs(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { + public void addCollabs(final @NotNull MediaType mediaType) { final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... - final URI resourceUri = addNewMap(requestHeaders, template, "Map for addCollabs - " + mediaType); + final URI resourceUri = addNewMap(template, "Map for addCollabs - " + mediaType); // Add a new collaboration ... requestHeaders.setContentType(MediaType.APPLICATION_JSON); @@ -270,12 +267,12 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void updateCollabType(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { + public void updateCollabType(final @NotNull MediaType mediaType) { final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... - final URI resourceUri = addNewMap(requestHeaders, template, "Map for updateCollabType - " + mediaType); + final URI resourceUri = addNewMap(template, "Map for updateCollabType - " + mediaType); // Add a new collaboration ... requestHeaders.setContentType(MediaType.APPLICATION_JSON); @@ -310,12 +307,12 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void deleteCollabs(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { + public void deleteCollabs(final @NotNull MediaType mediaType) { final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... - final URI resourceUri = addNewMap(requestHeaders, template, "Map for deleteCollabs - " + mediaType); + final URI resourceUri = addNewMap(template, "Map for deleteCollabs - " + mediaType); // Add a new collaboration ... requestHeaders.setContentType(MediaType.APPLICATION_JSON); @@ -355,13 +352,13 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, expectedExceptions = {HttpClientErrorException.class}, dataProvider = "ContentType-Provider-Function") - public void addCollabsInvalidOwner(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { + public void addCollabsInvalidOwner(final @NotNull MediaType mediaType) { final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); // Create a sample map ... - final URI resourceUri = addNewMap(requestHeaders, template, "Map for Collaboration - " + mediaType); + final URI resourceUri = addNewMap(template, "Map for Collaboration - " + mediaType); // Add a new collaboration ... requestHeaders.setContentType(MediaType.APPLICATION_JSON); @@ -380,12 +377,12 @@ public class RestMindmapITCase { } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void removeLabelFromMindmap(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void removeLabelFromMindmap(final @NotNull MediaType mediaType) { // Configure media types ... throw new SkipException("missing test: label removal from map"); } @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") - public void deleteMapAndCheckLabels(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... + public void deleteMapAndCheckLabels(final @NotNull MediaType mediaType) { // Configure media types ... throw new SkipException("missing test: delete map should not affects others labels"); } @@ -404,7 +401,7 @@ public class RestMindmapITCase { // Create a sample map ... final String mapTitle = "Maps 1 - " + mediaType; - final URI mindmapUri = addNewMap(requestHeaders, template, mapTitle); + final URI mindmapUri = addNewMap(template, mapTitle); final String mapId = mindmapUri.getPath().replace("/service/maps/", ""); // Assign label to map ... @@ -432,22 +429,15 @@ public class RestMindmapITCase { } - private URI addNewMap(@NotNull HttpHeaders requestHeaders, @NotNull RestTemplate template, @NotNull String title, @Nullable String xml) throws IOException, WiseMappingException { - final RestMindmap restMindmap = new RestMindmap(); - restMindmap.setTitle(title); - restMindmap.setDescription("My Map Desc"); - - if (xml != null) { - restMindmap.setXml(xml); - } - + private URI addNewMap(@NotNull RestTemplate template, @NotNull String title, @Nullable String xml) { // Create a new map ... - HttpEntity createUserEntity = new HttpEntity<>(restMindmap, requestHeaders); - return template.postForLocation(BASE_REST_URL + "/maps", createUserEntity); + final HttpHeaders requestHeaders = createHeaders(MediaType.APPLICATION_XML); + HttpEntity createUserEntity = new HttpEntity<>(xml, requestHeaders); + return template.postForLocation(BASE_REST_URL + "/maps?title=" + title, createUserEntity); } - private URI addNewMap(@NotNull HttpHeaders requestHeaders, @NotNull RestTemplate template, @NotNull String title) throws IOException, WiseMappingException { - return addNewMap(requestHeaders, template, title, null); + private URI addNewMap(@NotNull RestTemplate template, @NotNull String title) { + return addNewMap(template, title, null); } } From 4f662acefed314e4feea2f5aee94c2fd63bc5755 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 11 Feb 2022 18:06:31 -0800 Subject: [PATCH 5/5] Bump up version --- pom.xml | 4 ++-- wise-ui/pom.xml | 6 +++--- wise-webapp/pom.xml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 8ce6d270..9e1709b6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 5.0.3-SNAPSHOT + 5.0.4 ${project.basedir}/wise-webapps @@ -16,7 +16,7 @@ org.wisemapping wisemapping WiseMapping Project - 5.0.3-SNAPSHOT + 5.0.4 pom diff --git a/wise-ui/pom.xml b/wise-ui/pom.xml index e700437d..b9fa0b63 100644 --- a/wise-ui/pom.xml +++ b/wise-ui/pom.xml @@ -12,7 +12,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.3-SNAPSHOT + 5.0.4 @@ -33,7 +33,7 @@ - + @@ -46,7 +46,7 @@ - + diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 2dda52b4..c64e66c9 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.3-SNAPSHOT + 5.0.4