diff --git a/distribution/package-bin.sh b/distribution/package-bin.sh index baf41057..65d7c6ef 100755 --- a/distribution/package-bin.sh +++ b/distribution/package-bin.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x set -e set -u @@ -46,7 +45,6 @@ unzip $BASE_DIR/../wise-webapp/target/wisemapping.war -d $WISE_WEBAPP_DIR >/dev/ sed 's/\${database.base.url}\/db\/wisemapping/webapps\/wisemapping\/WEB-INF\/database\/wisemapping/' $WISE_WEBAPP_DIR/WEB-INF/app.properties > $WISE_WEBAPP_DIR/WEB-INF/app.properties2 mv $WISE_WEBAPP_DIR/WEB-INF/app.properties2 $WISE_WEBAPP_DIR/WEB-INF/app.properties - mkdir $WISE_WEBAPP_DIR/WEB-INF/database cp -r $BASE_DIR/../wise-webapp/target/db/* $WISE_WEBAPP_DIR/WEB-INF/database/ cp $BASE_DIR/wisemapping.xml $JETTY_DIR/contexts/ @@ -54,6 +52,7 @@ cp $BASE_DIR/wisemapping.xml $JETTY_DIR/contexts/ # Distribute scripts cp -r $BASE_DIR/../wise-webapp/src/test/sql $TARGET_DIR/wisemapping-$WISE_VERSION/config +cp ./start.sh ${JETTY_DIR}/ # Store version echo $1 > $WISE_WEBAPP_DIR/version diff --git a/distribution/start.sh b/distribution/start.sh new file mode 100755 index 00000000..54b16c2a --- /dev/null +++ b/distribution/start.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +java -Xmx256m -Dorg.apache.jasper.compiler.disablejsr199=true -jar start.jar + diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 44d0ab71..8b9cbb76 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -167,39 +167,40 @@ mindplot.Designer = new Class({ } // Enable drag events ... - Element.NativeEvents.dragenter = 2; - Element.NativeEvents.dragexit = 2; - Element.NativeEvents.dragover = 2; - Element.NativeEvents.drop = 2; - - screenManager.addEvent('dragenter', noopHandler); - screenManager.addEvent('dragexit', noopHandler); - screenManager.addEvent('dragover', noopHandler); - screenManager.addEvent('drop', function (evt) { - evt.stopPropagation(); - evt.preventDefault(); + // @Todo: Images support on progress ... +// Element.NativeEvents.dragenter = 2; +// Element.NativeEvents.dragexit = 2; +// Element.NativeEvents.dragover = 2; +// Element.NativeEvents.drop = 2; // - var files = evt.event.dataTransfer.files; - console.log(event); - - var count = files.length; - - // Only call the handler if 1 or more files was dropped. - if (count > 0) { - - var model = this.getMindmap().createNode(); - model.setImageSize(80, 43); - model.setMetadata("{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}"); - model.setImageUrl("images/logo-small.png"); - model.setShapeType(mindplot.model.TopicShape.IMAGE); - - var position = screenManager.getWorkspaceMousePosition(evt); - model.setPosition(position.x, position.y); - model.setPosition(100, 100); - - this._actionDispatcher.addTopics([model]); - } - }.bind(this)); +// screenManager.addEvent('dragenter', noopHandler); +// screenManager.addEvent('dragexit', noopHandler); +// screenManager.addEvent('dragover', noopHandler); +// screenManager.addEvent('drop', function (evt) { +// evt.stopPropagation(); +// evt.preventDefault(); +//// +// var files = evt.event.dataTransfer.files; +// console.log(event); +// +// var count = files.length; +// +// // Only call the handler if 1 or more files was dropped. +// if (count > 0) { +// +// var model = this.getMindmap().createNode(); +// model.setImageSize(80, 43); +// model.setMetadata("{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}"); +// model.setImageUrl("images/logo-small.png"); +// model.setShapeType(mindplot.model.TopicShape.IMAGE); +// +// var position = screenManager.getWorkspaceMousePosition(evt); +// model.setPosition(position.x, position.y); +// model.setPosition(100, 100); +// +// this._actionDispatcher.addTopics([model]); +// } +// }.bind(this)); }, diff --git a/mindplot/src/main/javascript/DesignerModel.js b/mindplot/src/main/javascript/DesignerModel.js index 66d0bad9..e5bf93ce 100644 --- a/mindplot/src/main/javascript/DesignerModel.js +++ b/mindplot/src/main/javascript/DesignerModel.js @@ -83,6 +83,7 @@ mindplot.DesignerModel = new Class({ addTopic:function (topic) { $assert(topic, "topic can not be null"); + $assert(typeof topic.getId() == "number", "id is not a number:" + topic.getId()); this._topics.push(topic); }, diff --git a/mindplot/src/main/javascript/NodeGraph.js b/mindplot/src/main/javascript/NodeGraph.js index f530cb70..77cffe74 100644 --- a/mindplot/src/main/javascript/NodeGraph.js +++ b/mindplot/src/main/javascript/NodeGraph.js @@ -38,6 +38,7 @@ mindplot.NodeGraph = new Class({ }, setId : function(id) { + $assert(typeof topic.getId() == "number", "id is not a number:" + id); this.getModel().setId(id); }, diff --git a/mindplot/src/main/javascript/StandaloneActionDispatcher.js b/mindplot/src/main/javascript/StandaloneActionDispatcher.js index bb248608..d285c708 100644 --- a/mindplot/src/main/javascript/StandaloneActionDispatcher.js +++ b/mindplot/src/main/javascript/StandaloneActionDispatcher.js @@ -54,7 +54,6 @@ mindplot.StandaloneActionDispatcher = new Class({ }; var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicId, position); - command.desc = "move topic"; this.execute(command); }, @@ -72,7 +71,6 @@ mindplot.StandaloneActionDispatcher = new Class({ return result; }; var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds); - command.desc = "changeFontStyleToTopic"; this.execute(command); }, @@ -85,9 +83,9 @@ mindplot.StandaloneActionDispatcher = new Class({ topic.setText(value); return result; }; + commandFunc.commandType = "changeTextToTopic"; var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, text); - command.desc = "changeTextToTopic"; this.execute(command); }, @@ -105,8 +103,6 @@ mindplot.StandaloneActionDispatcher = new Class({ }; var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicIds, fontFamily); - command.desc = "changeFontFamilyToTopic"; - this.execute(command); }, @@ -122,7 +118,6 @@ mindplot.StandaloneActionDispatcher = new Class({ var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, color); command.discardDuplicated = "fontColorCommandId"; - command.desc = "changeFontColorToTopic"; this.execute(command); }, @@ -138,8 +133,6 @@ mindplot.StandaloneActionDispatcher = new Class({ var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, color); command.discardDuplicated = "backColor"; - command.desc = "changeBackgroundColorToTopic"; - this.execute(command); }, @@ -155,8 +148,6 @@ mindplot.StandaloneActionDispatcher = new Class({ var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, color); command.discardDuplicated = "borderColorCommandId"; - command.desc = "changeBorderColorToTopic"; - this.execute(command); }, @@ -173,8 +164,6 @@ mindplot.StandaloneActionDispatcher = new Class({ }; var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, size); - command.desc = "changeFontSizeToTopic"; - this.execute(command); }, @@ -189,8 +178,6 @@ mindplot.StandaloneActionDispatcher = new Class({ }; var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, shapeType); - command.desc = "changeShapeTypeToTopic"; - this.execute(command); }, @@ -207,8 +194,6 @@ mindplot.StandaloneActionDispatcher = new Class({ }; var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds); - command.desc = "changeFontWeightToTopic"; - this.execute(command); }, @@ -221,8 +206,6 @@ mindplot.StandaloneActionDispatcher = new Class({ }; var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, collapse); - command.desc = "shrinkBranch"; - this.execute(command, false); }, @@ -268,7 +251,7 @@ mindplot.CommandContext = new Class({ var ids = designerTopics.map(function (topic) { return topic.getId(); }); - $assert(result.length == topicsIds.length, "Could not find topic. Result:" + result + ", Filter Criteria:" + topicsIds + ", Current Topics: " + ids); + $assert(result.length == topicsIds.length, "Could not find topic. Result:" + result + ", Filter Criteria:" + topicsIds + ", Current Topics: [" + ids + "]"); } return result; }, diff --git a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js index 9b149906..28e75605 100644 --- a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js +++ b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js @@ -32,19 +32,27 @@ mindplot.commands.GenericFunctionCommand = new Class({ execute:function (commandContext) { if (!this.applied) { - // @Todo: Debug hack. Remove - var topics; + var topics = null; try { topics = commandContext.findTopics(this._topicsId); } catch (e) { - throw new Error(e + "," + this._commandFunc + "," + this._commandFunc.desc); + if (this._commandFunc.commandType != "changeTextToTopic") { + // Workaround: For some reason, there is a combination of events that involves + // making some modification and firing out of focus event. This is causing + // that a remove node try to be removed. In some other life, I will come with the solution. + // Almost aways occurs with IE9. I could be related with some change of order in sets o something similar. + throw e; + } } - topics.each(function (topic) { - var oldValue = this._commandFunc(topic, this._value); - this._oldValues.push(oldValue); - }.bind(this)); + if (topics != null) { + topics.each(function (topic) { + var oldValue = this._commandFunc(topic, this._value); + this._oldValues.push(oldValue); + }.bind(this)); + } this.applied = true; + } else { throw "Command can not be applied two times in a row."; } diff --git a/web2d/src/main/javascript/peer/svg/ElementPeer.js b/web2d/src/main/javascript/peer/svg/ElementPeer.js index 1966f5b7..d16f0323 100644 --- a/web2d/src/main/javascript/peer/svg/ElementPeer.js +++ b/web2d/src/main/javascript/peer/svg/ElementPeer.js @@ -17,7 +17,7 @@ */ web2d.peer.svg.ElementPeer = new Class({ - initialize :function(svgElement) { + initialize:function (svgElement) { this._native = svgElement; if (!this._native.addEvent) { // Hack bug: https://bugzilla.mozilla.org/show_bug.cgi?id=740811 @@ -26,16 +26,16 @@ web2d.peer.svg.ElementPeer = new Class({ } } - this._size = {width:1,height:1}; + this._size = {width:1, height:1}; this._changeListeners = {}; // http://support.adobe.com/devsup/devsup.nsf/docs/50493.htm }, - setChildren : function(children) { + setChildren:function (children) { this._children = children; }, - getChildren : function() { + getChildren:function () { var result = this._children; if (!$defined(result)) { result = []; @@ -44,15 +44,15 @@ web2d.peer.svg.ElementPeer = new Class({ return result; }, - getParent : function() { + getParent:function () { return this._parent; }, - setParent : function(parent) { + setParent:function (parent) { this._parent = parent; }, - appendChild : function(elementPeer) { + appendChild:function (elementPeer) { // Store parent and child relationship. elementPeer.setParent(this); var children = this.getChildren(); @@ -66,20 +66,17 @@ web2d.peer.svg.ElementPeer = new Class({ }, - removeChild : function(elementPeer) { + removeChild:function (elementPeer) { // Store parent and child relationship. elementPeer.setParent(null); var children = this.getChildren(); // Remove from children array ... - var length = children.length; + var oldLength = children.length; children.erase(elementPeer); + $assert(children.length < oldLength, "element could not be removed:" + elementPeer); - var newLength = children.length; - if (newLength >= length) { - throw "Could not remove the element."; - } // Append element as a child. this._native.removeChild(elementPeer._native); }, @@ -88,23 +85,23 @@ web2d.peer.svg.ElementPeer = new Class({ * http://www.w3.org/TR/DOM-Level-3-Events/events.html * http://developer.mozilla.org/en/docs/addEvent */ - addEvent : function(type, listener) { + addEvent:function (type, listener) { this._native.addEvent(type, listener); }, - fireEvent : function(type, event) { + fireEvent:function (type, event) { this._native.fireEvent(type, event); }, - cloneEvents : function(from) { + cloneEvents:function (from) { this._native.cloneEvents(from); }, - removeEvent : function(type, listener) { + removeEvent:function (type, listener) { this._native.removeEvent(type, listener); }, - setSize : function(width, height) { + setSize:function (width, height) { if ($defined(width) && this._size.width != parseInt(width)) { this._size.width = parseInt(width); this._native.setAttribute('width', parseInt(width)); @@ -118,11 +115,11 @@ web2d.peer.svg.ElementPeer = new Class({ web2d.peer.utils.EventUtils.broadcastChangeEvent(this, "strokeStyle"); }, - getSize : function() { - return {width:this._size.width,height:this._size.height}; + getSize:function () { + return {width:this._size.width, height:this._size.height}; }, - setFill : function(color, opacity) { + setFill:function (color, opacity) { if ($defined(color)) { this._native.setAttribute('fill', color); } @@ -131,22 +128,22 @@ web2d.peer.svg.ElementPeer = new Class({ } }, - getFill : function() { + getFill:function () { var color = this._native.getAttribute('fill'); var opacity = this._native.getAttribute('fill-opacity'); return {color:color, opacity:Number(opacity)}; }, - getStroke : function() { + getStroke:function () { var vmlStroke = this._native; var color = vmlStroke.getAttribute('stroke'); var dashstyle = this._stokeStyle; var opacity = vmlStroke.getAttribute('stroke-opacity'); var width = vmlStroke.getAttribute('stroke-width'); - return {color: color, style: dashstyle, opacity: opacity, width: width}; + return {color:color, style:dashstyle, opacity:opacity, width:width}; }, - setStroke : function(width, style, color, opacity) { + setStroke:function (width, style, color, opacity) { if ($defined(width)) { this._native.setAttribute('stroke-width', width + "px"); } @@ -182,16 +179,16 @@ web2d.peer.svg.ElementPeer = new Class({ /* * style='visibility: visible' */ - setVisibility : function(isVisible) { + setVisibility:function (isVisible) { this._native.setAttribute('visibility', (isVisible) ? 'visible' : 'hidden'); }, - isVisible : function() { + isVisible:function () { var visibility = this._native.getAttribute('visibility'); return !(visibility == 'hidden'); }, - updateStrokeStyle : function() { + updateStrokeStyle:function () { var strokeStyle = this._stokeStyle; if (this.getParent()) { if (strokeStyle && strokeStyle != 'solid') { @@ -200,7 +197,7 @@ web2d.peer.svg.ElementPeer = new Class({ } }, - attachChangeEventListener : function(type, listener) { + attachChangeEventListener:function (type, listener) { var listeners = this.getChangeEventListeners(type); if (!$defined(listener)) { throw "Listener can not be null"; @@ -208,7 +205,7 @@ web2d.peer.svg.ElementPeer = new Class({ listeners.push(listener); }, - getChangeEventListeners : function(type) { + getChangeEventListeners:function (type) { var listeners = this._changeListeners[type]; if (!$defined(listeners)) { listeners = []; @@ -217,7 +214,7 @@ web2d.peer.svg.ElementPeer = new Class({ return listeners; }, - positionRelativeTo : function(elem, options) { + positionRelativeTo:function (elem, options) { options = !$defined(options) ? {} : options; options['relativeTo'] = $(this._native); elem.position(options); @@ -227,18 +224,18 @@ web2d.peer.svg.ElementPeer = new Class({ /** * Move element to the front */ - moveToFront : function() { + moveToFront:function () { this._native.parentNode.appendChild(this._native); }, /** * Move element to the back */ - moveToBack : function() { + moveToBack:function () { this._native.parentNode.insertBefore(this._native, this._native.parentNode.firstChild); }, - setCursor : function(type) { + setCursor:function (type) { this._native.style.cursor = type; } }); @@ -246,5 +243,5 @@ web2d.peer.svg.ElementPeer = new Class({ web2d.peer.svg.ElementPeer.prototype.svgNamespace = 'http://www.w3.org/2000/svg'; web2d.peer.svg.ElementPeer.prototype.linkNamespace = 'http://www.w3.org/1999/xlink'; -web2d.peer.svg.ElementPeer.prototype.__stokeStyleToStrokDasharray = {solid:[],dot:[1,3],dash:[4,3],longdash:[10,2],dashdot:[5,3,1,3]}; +web2d.peer.svg.ElementPeer.prototype.__stokeStyleToStrokDasharray = {solid:[], dot:[1, 3], dash:[4, 3], longdash:[10, 2], dashdot:[5, 3, 1, 3]}; diff --git a/wise-editor/src/main/webapp/js/editor.js b/wise-editor/src/main/webapp/js/editor.js index f937f0e0..6a7b2456 100644 --- a/wise-editor/src/main/webapp/js/editor.js +++ b/wise-editor/src/main/webapp/js/editor.js @@ -39,7 +39,7 @@ function buildDesigner(options) { return; } - // Trasform error ... + // Transform error ... var errorMsg = message; if (typeof(message) === 'object' && message.srcElement && message.target) { if (message.srcElement == '[object HTMLScriptElement]' && message.target == '[object HTMLScriptElement]') { @@ -57,7 +57,7 @@ function buildDesigner(options) { emulation:false, urlEncoded:false }).post(JSON.encode({ - jsErrorMsg:"Message: '" + errorMsg + "', line:'" + lineNo + "', :" + url, + jsErrorMsg:"Message: '" + errorMsg + "', line:'" + lineNo + "', url: :" + url, jsStack:window.errorStack, userAgent:navigator.userAgent, mapId:options.mapId})); diff --git a/wise-editor/src/main/webapp/samples/welcome.xml b/wise-editor/src/main/webapp/samples/welcome.xml index 69cdd8f8..cac5906b 100644 --- a/wise-editor/src/main/webapp/samples/welcome.xml +++ b/wise-editor/src/main/webapp/samples/welcome.xml @@ -1,197 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - + \ No newline at end of file diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index c2dcbdf6..aedf280a 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -95,6 +95,12 @@ ${org.springframework.version} compile + + org.slf4j + slf4j-log4j12 + 1.7.2 + runtime + org.springframework spring-web @@ -255,7 +261,7 @@ log4j log4j - 1.2.9 + 1.2.17 compile @@ -280,7 +286,7 @@ org.slf4j slf4j-api - 1.6.4 + 1.7.2 runtime diff --git a/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java b/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java index adfe3954..dd6590d7 100644 --- a/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java +++ b/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java @@ -18,29 +18,51 @@ package com.wisemapping.filter; -import com.wisemapping.exceptions.GoogleChromeFrameRequiredException; -import com.wisemapping.exceptions.UnsupportedBrowserException; import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.core.env.Environment; +import org.springframework.core.env.MutablePropertySources; +import org.springframework.core.env.PropertySource; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.util.HashMap; import java.util.Map; -import java.util.Set; +import java.util.regex.Pattern; + public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter { - private Map attributes; + @Value("${google.analytics.enabled}") + private Boolean analyticsEnabled; + + @Value("${google.analytics.account}") + private String analyticsAccount; + + @Value("${google.ads.enabled}") + private Boolean adsEnabled; + + @Value("${site.homepage}") + private String siteHomepage; + + @Autowired + Environment env; public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, Object object) throws Exception { - for (String key : attributes.keySet()) { - request.setAttribute(key, attributes.get(key)); + + request.setAttribute("google.analytics.enabled", analyticsEnabled); + request.setAttribute("google.analytics.account", analyticsAccount); + request.setAttribute("google.ads.enabled", adsEnabled); + request.setAttribute("site.homepage", siteHomepage); + + final String baseUrl; + if (env.containsProperty("site.baseurl")) { + baseUrl = env.getProperty("site.baseurl"); + } else { + baseUrl = request.getRequestURL().toString().replace(request.getRequestURI(), request.getContextPath()); } + request.setAttribute("site.baseurl", baseUrl); return true; } - - public void setAttributes(Map attributes) { - this.attributes = attributes; - } } diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index 9bd5ed8d..7ae0c865 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -27,6 +27,7 @@ import org.apache.commons.lang.StringEscapeUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import javax.servlet.http.HttpServletRequest; import java.io.PrintWriter; @@ -37,12 +38,14 @@ import java.util.Map; final public class NotificationService { - + public static final String DEFAULT_WISE_URL = "http://localhost:8080/wisemapping"; @Autowired private Mailer mailer; - private String baseUrl; + private NotifierFilter notificationFilter; + private String baseUrl; + public NotificationService() { this.notificationFilter = new NotifierFilter(); } @@ -64,8 +67,8 @@ final public class NotificationService { model.put("mindmap", mindmap); model.put("message", "message"); model.put("ownerName", user.getFirstname()); - model.put("mapEditUrl", baseUrl + "/c/maps/" + mindmap.getId() + "/edit"); - model.put("baseUrl", baseUrl); + model.put("mapEditUrl", getBaseUrl() + "/c/maps/" + mindmap.getId() + "/edit"); + model.put("baseUrl", getBaseUrl()); model.put("senderMail", user.getEmail()); model.put("message", message); model.put("supportEmail", mailer.getSupportEmail()); @@ -83,7 +86,7 @@ final public class NotificationService { final String messageBody = "

Someone, most likely you, requested a new password for your WiseMapping account.

\n" + "

Here is your new password: " + temporalPassword + "

\n" + - "

You can login clicking here. We strongly encourage you to change the password as soon as possible.

"; + "

You can login clicking here. We strongly encourage you to change the password as soon as possible.

"; sendTemplateMail(user, mailSubject, messageTitle, messageBody); } @@ -112,7 +115,7 @@ final public class NotificationService { model.put("firstName", user.getFirstname()); model.put("messageTitle", messageTitle); model.put("messageBody", messageBody); - model.put("baseUrl", this.baseUrl); + model.put("baseUrl", getBaseUrl()); model.put("supportEmail", mailer.getSupportEmail()); mailer.sendEmail(mailer.getServerSenderEmail(), user.getEmail(), mailSubject, model, "baseLayout.vm"); @@ -127,10 +130,6 @@ final public class NotificationService { } - public void setBaseUrl(String baseUrl) { - this.baseUrl = baseUrl; - } - public void setMailer(Mailer mailer) { this.mailer = mailer; } @@ -227,6 +226,17 @@ final public class NotificationService { return retValue; } + public String getBaseUrl() { + if ("${site.baseurl}".equals(baseUrl)) { + baseUrl = DEFAULT_WISE_URL; + System.err.println("Warning: site.baseurl has not being configured. Mail site references could be not properly sent. Using :" + baseUrl); + } + return baseUrl; + } + + public void setBaseUrl(String baseUrl) { + this.baseUrl = baseUrl; + } } diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/AccessAuditory.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/AccessAuditory.hbm.xml index c9eb20da..8586119d 100755 --- a/wise-webapp/src/main/resources/com/wisemapping/model/AccessAuditory.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/AccessAuditory.hbm.xml @@ -1,7 +1,7 @@ + "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/Collaboration.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/Collaboration.hbm.xml index a07f023f..51808281 100644 --- a/wise-webapp/src/main/resources/com/wisemapping/model/Collaboration.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/Collaboration.hbm.xml @@ -1,7 +1,7 @@ + "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/CollaborationProperties.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/CollaborationProperties.hbm.xml index 905f9bf0..6e9908d6 100644 --- a/wise-webapp/src/main/resources/com/wisemapping/model/CollaborationProperties.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/CollaborationProperties.hbm.xml @@ -1,7 +1,7 @@ + "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/Collaborator.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/Collaborator.hbm.xml index 4bc92e65..ef094032 100755 --- a/wise-webapp/src/main/resources/com/wisemapping/model/Collaborator.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/Collaborator.hbm.xml @@ -1,7 +1,7 @@ + "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/MindMapHistory.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/MindMapHistory.hbm.xml index b265e130..e1320af4 100755 --- a/wise-webapp/src/main/resources/com/wisemapping/model/MindMapHistory.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/MindMapHistory.hbm.xml @@ -1,7 +1,7 @@ + "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/Mindmap.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/Mindmap.hbm.xml index 45c43afa..823a0725 100644 --- a/wise-webapp/src/main/resources/com/wisemapping/model/Mindmap.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/Mindmap.hbm.xml @@ -1,7 +1,7 @@ + "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/wise-webapp/src/main/webapp/WEB-INF/app.properties b/wise-webapp/src/main/webapp/WEB-INF/app.properties index 9d9189e3..f0aa2f30 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/app.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/app.properties @@ -80,8 +80,10 @@ google.recaptcha.publicKey = 6LeQ4tISAAAAALzCGKNgRv8UqsDx7Cb0vq4wbJBr # etc. admin.user = admin@wisemapping.org -# Site URL. This url will be used during sharing emails and public views. -site.baseurl = http://localhost:8080/wisemapping +# Base URL where WiseMapping is deployed. By default, It will be automatically inferred. +# If you are planning to put wisemapping behind an Apache using an Apache Proxy setup, you must enable this property. +# site.baseurl = http:///example.com:8080/wisemapping + # Site Homepage URL. This will be used as URL for homepage location. site.homepage = c/home 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 5f160b6e..d8759994 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties @@ -4,7 +4,8 @@ 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.hibernate=WARN,stdout,R -log4j.logger.org.hibernate.SQL=true +log4j.logger.org.hibernate.engine.StatefulPersistenceContext=ERROR,stdout,R +#log4j.logger.org.hibernate.SQL=WARN,stdout,R # Stdout logger � diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-dao.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-dao.xml index 1f690e87..c8017226 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-dao.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-dao.xml @@ -7,9 +7,6 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> - - - diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index 92352c2d..a84c5a99 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -11,8 +11,6 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> - - @@ -72,9 +70,4 @@ - - - - - \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml index bbd9fcf5..8ebbd33f 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml @@ -1,8 +1,11 @@ + http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> + + diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml index 215414ce..76584ef5 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml @@ -14,9 +14,7 @@ - + @@ -38,18 +36,8 @@ - - - - - - - - - - - - + + @@ -110,10 +98,4 @@ - - - - diff --git a/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp b/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp index 5abb179d..b7cc410d 100644 --- a/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp +++ b/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp @@ -16,7 +16,7 @@ - + diff --git a/wise-webapp/src/main/webapp/jsp/init.jsp b/wise-webapp/src/main/webapp/jsp/init.jsp index 040b1cf2..91b72cbb 100644 --- a/wise-webapp/src/main/webapp/jsp/init.jsp +++ b/wise-webapp/src/main/webapp/jsp/init.jsp @@ -2,6 +2,3 @@ <%@taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> - - - diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index 08490c72..6220266e 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -11,7 +11,7 @@ <%--@elvariable id="mapXml" type="com.wisemapping.model.User"--%> - + <spring:message code="SITE.TITLE"/> - <c:out value="${mindmap.title}"/>