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 a282f8b8..fd694392 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -1,7 +1,6 @@ package com.wisemapping.rest; -import com.sun.jdi.IntegerType; import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.model.MindMap; import com.wisemapping.model.MindmapUser; diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties index 8abef6ba..8eaa1dff 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties @@ -1,7 +1,7 @@ log4j.rootLogger=WARN, stdout, R log4j.logger.com.wisemapping=WARN,stdout,R -log4j.logger.org.springframework=WARN,stdout,R -log4j.logger.org.codehaus.jackson=WARN,stdout,R +log4j.logger.org.springframework=DEBUG,stdout,R +log4j.logger.org.codehaus.jackson=DEBUG,stdout,R # Stdout logger � log4j.appender.stdout=org.apache.log4j.ConsoleAppender diff --git a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml index 5cde8630..40fb68f3 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml @@ -115,11 +115,6 @@ - - - - - diff --git a/wise-webapp/src/main/webapp/js/Panel.js b/wise-webapp/src/main/webapp/js/Panel.js deleted file mode 100644 index 79f5c63a..00000000 --- a/wise-webapp/src/main/webapp/js/Panel.js +++ /dev/null @@ -1,102 +0,0 @@ -/* -* Copyright [2011] [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. -*/ - -var Panel = new Class({ - options:{ - width:'140px', - height:250, - opacity:0.9, - panelButton:null, - content:null, - frame:null, - onStart:Class.empty, - onComplete:Class.empty - }, - initialize:function(options){ - this.setOptions(options); - - this.buildBody(); - - //atach listener to button - this.options.panelButton.addEvent('click',this.openPanel.bindWithEvent(this)); - }, - buildBody:function(){ - var opts = this.options; - opts.frame = new Element('div'); - if($defined(opts.content)) - { - this.setContent(opts.content); - } - - }, - setContent:function(content){ - this.options.content=content; - this.options.content.inject(this.options.frame); - this.setInitialStyles(); - this.options.frame.injectBefore(this.options.panelButton); - }, - setInitialStyles:function(){ - var opts = this.options; - var buttonTop = opts.panelButton.getTop(); - var buttonLeft = opts.panelButton.getLeft(); - var bodyHeight = parseInt(opts.panelButton.getParent().getStyle('height')); - var coordinates = opts.panelButton.getCoordinates(); - var width = opts.width || coordinates.width; - var elemCoords = { - top:'0px', - left:coordinates.left, - width:width, - height:'0px', - zIndex:'10', - overflow:'hidden' - }; - var elemStyles = { - backgroundColor: opts.backgroundColor||'blue', - opacity: opts.opacity, - position:'absolute' - } - opts.frame.setStyles(elemCoords).setStyles(elemStyles); - }, - openPanel:function(){ - this.fireEvent('onStart'); - - var button = this.options.panelButton; - button.removeEvents('click'); - button.addEvent('click',this.hidePanel.bindWithEvent(this)); - var top = parseInt(this.options.frame.getStyle('top')); - var fx = this.options.frame.effects({duration:500, onComplete:function(){this.options.content.fireEvent('show');}.bind(this)}); - fx.start({'height':[0,this.options.height],'top':[top, top-this.options.height]}); - - this.fireEvent('onComplete'); - }, - hidePanel:function(){ - this.fireEvent('onStart'); - - var button = this.options.panelButton; - button.removeEvents('click'); - button.addEvent('click',this.openPanel.bindWithEvent(this)); - var top = parseInt(this.options.frame.getStyle('top')); - this.options.content.fireEvent('hide'); - var fx = this.options.frame.effects({duration:500}); - fx.start({'height':[this.options.height,0],'top':[top, top+this.options.height]}); - - this.fireEvent('onComplete'); - } -}); - -Panel.implement(new Events, new Options); \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/js/jquery.dataTables.plugins.js b/wise-webapp/src/main/webapp/js/jquery.dataTables.plugins.js index 0a714f12..54800b7e 100644 --- a/wise-webapp/src/main/webapp/js/jquery.dataTables.plugins.js +++ b/wise-webapp/src/main/webapp/js/jquery.dataTables.plugins.js @@ -50,7 +50,6 @@ jQuery.fn.dataTableExt.removeSelectedRows = function() { url: "../service/maps/batch?ids=" + mapIds.join(","), type:"DELETE", success : function(data, textStatus, jqXHR) { - console.log("delete success"); var trs = $('.select input:checked[id!="selectAll"]').parent().parent(); trs.each(function() { $('#mindmapListTable').dataTable().fnDeleteRow(this); @@ -60,6 +59,4 @@ jQuery.fn.dataTableExt.removeSelectedRows = function() { alert("Unexpected error removing maps. Refresh before continue."); } }); - - }; diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index 2025b3d7..9d618a4a 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -9,8 +9,6 @@ - - @@ -163,8 +161,37 @@ $("#buttons .newMap").button({ icons: { primary: "ui-icon-circle-plus" } }).click(function() { - window.location = "c/newMap.htm" - }); + $("#new-dialog-modal").dialog({ + modal: true, + buttons: { + "Create": function() { + var formData = {}; + $('#new-dialog-modal input').each(function(index, elem) { + formData[elem.name] = elem.value; + }); + + jQuery.ajax("../service/maps", { + async:false, + dataType: 'json', + data: JSON.stringify(formData), + type: 'POST', + contentType:"application/json; charset=utf-8", + success : function(data, textStatus, jqXHR) { + var location = jqXHR.getResponseHeader("Location"); + var mapId = location.substring(location.lastIndexOf('/') + 1, location.length); + window.location = "c/editor.htm?action=open&mapId=" + mapId; + }, + error: function() { + alert("Unexpected error removing maps. Refresh before continue."); + } + }); + }, + Cancel: function() { + $(this).dialog("close"); + } + } + }); + }); $("#buttons .importMap").button({ icons: { primary: "ui-icon-trash" } @@ -196,8 +223,6 @@ } }); }); - - @@ -217,6 +242,27 @@ Are you sure you want to delete maps ? + + + + + * + : + + + + + + + + : + + + + + + + Are you sure you want to share maps ? diff --git a/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java b/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java index e19df354..41e638b0 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java @@ -14,11 +14,30 @@ public class JsonTest { @Test void deserialize() throws IOException { - String mapJson = "{\"id\":\"1\",\"xml\":\"\",\"properties\":\"{\\\"zoom\\\":0.85}\"}"; + ObjectMapper mapper = new ObjectMapper(); - final RestMindmap restMindmap = mapper.readValue(mapJson, RestMindmap.class); + + String json1 = "{\"id\":\"1\",\"xml\":\"\",\"properties\":\"{\\\"zoom\\\":0.85}\"}"; + mapper.readValue(json1, RestMindmap.class); + + String json2 = "{\"title\":\"some title\",\"description\":\"description here\"}"; + mapper.readValue(json2, RestMindmap.class); String userJson = "{\"username\":\"admin\",\"email\":\"admin@wisemapping.org\",\"tags\":[],\"creationDate\":1329706800000,\"firstname\":\"Wise\",\"lastname\":\"test\",\"password\":\"test\"}"; final RestUser restUser = mapper.readValue(userJson, RestUser.class); } + + @Test + void serialize() throws IOException { + String mapJson = "{\"id\":\"1\",\"xml\":\"\",\"properties\":\"{\\\"zoom\\\":0.85}\"}"; + ObjectMapper mapper = new ObjectMapper(); + + final RestMindmap value = new RestMindmap(); + value.setTitle("titl"); + value.setTitle("desck"); + final String restMindmap = mapper.writeValueAsString(value); + System.out.println(restMindmap); + } + + }
Are you sure you want to delete maps ?
Are you sure you want to share maps ?