Merge branch 'master' into db-purge

Conflicts:
	mindplot/src/main/javascript/MainTopic.js
	wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java
	wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java
This commit is contained in:
Paulo Gustavo Veiga
2012-11-04 01:38:52 -03:00
31 changed files with 1690 additions and 300 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2012] [wisemapping]
* 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
@@ -28,6 +28,7 @@ import com.wisemapping.jaxb.freemind.*;
import com.wisemapping.jaxb.wisemap.RelationshipType;
import com.wisemapping.jaxb.wisemap.TopicType;
import com.wisemapping.jaxb.wisemap.Icon;
import org.apache.commons.lang.StringEscapeUtils;
import org.jetbrains.annotations.NotNull;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
@@ -164,11 +165,13 @@ public class FreemindExporter
}
// Formated text have a different representation ....
if (!text.contains("\n")) {
freemindNode.setTEXT(text);
} else {
final Richcontent richcontent = buildRichContent(text, "NODE");
freemindNode.getArrowlinkOrCloudOrEdge().add(richcontent);
if (text != null) {
if (!text.contains("\n")) {
freemindNode.setTEXT(text);
} else {
final Richcontent richcontent = buildRichContent(text, "NODE");
freemindNode.getArrowlinkOrCloudOrEdge().add(richcontent);
}
}
freemindNode.setBACKGROUNDCOLOR(mindmapTopic.getBgColor());
@@ -202,7 +205,8 @@ public class FreemindExporter
final StringBuilder htmlContent = new StringBuilder("<html><head></head><body>");
for (String line : text.split("\n")) {
htmlContent.append("<p>").append(line.trim()).append("</p>");
line = StringEscapeUtils.escapeXml(line);
htmlContent.append("<p>").append(line).append("</p>");
}
htmlContent.append("</body></html>");

View File

@@ -357,7 +357,7 @@ public class FreemindImporter
* 3 -> 2
* 4 -> 4
*/
private int calcFirstLevelOrder(@NotNull List<Object> freeChilden, @NotNull Node freeChild) {
private int calcFirstLevelOrder(@NotNull List<Object> freeChilden, @Nullable Node freeChild) {
final List<Node> nodes = new ArrayList<Node>();
int result;

View File

@@ -123,7 +123,8 @@ final public class NotificationService {
private void handleException(Exception e) {
System.err.println("An expected error has occurred trying to send an email notification. Usually, the main reason for this is that the SMTP server properties has not been configured properly. Edit the WEB-INF/app.properties file and verify the SMTP server configuration properties.");
e.printStackTrace();
System.err.println("Cause:" + e.getMessage());
}
public void setBaseUrl(String baseUrl) {

View File

@@ -52,9 +52,6 @@ public class UsersController {
@Autowired
private UserService userService;
@Value("${registration.email.enabled}")
boolean emailConfirmEnabled;
@Autowired
private ReCaptcha captchaService;
@@ -111,11 +108,13 @@ public class UsersController {
user.setFirstname(userBean.getFirstname());
user.setLastname(userBean.getLastname());
user.setPassword(userBean.getPassword());
userService.createUser(user, emailConfirmEnabled);
boolean confirmRegistrationByEmail = false;
userService.createUser(user, confirmRegistrationByEmail);
// Forward to the success view ...
result = new ModelAndView("userRegistrationSuccess");
result.addObject("confirmByEmail", emailConfirmEnabled);
result.addObject("confirmByEmail", confirmRegistrationByEmail);
}
return result;
}

View File

@@ -18,6 +18,7 @@
package com.wisemapping.rest;
import com.wisemapping.exceptions.ClientException;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestUser;

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2012] [wisemapping]
* 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
@@ -25,7 +25,6 @@ import com.wisemapping.mail.NotificationService;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestErrors;
import com.wisemapping.security.Utils;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -43,8 +42,6 @@ import java.util.Locale;
public class BaseController {
final protected static Logger logger = Logger.getLogger("com.wisemapping.rest");
@Qualifier("messageSource")
@Autowired
private ResourceBundleMessageSource messageSource;
@@ -59,8 +56,8 @@ public class BaseController {
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ResponseBody
public RestErrors handleClientErrors(@NotNull IllegalArgumentException ex) {
ex.printStackTrace();
return new RestErrors(ex.getMessage(), Severity.SEVERE);
System.err.println(ex.getMessage());
return new RestErrors(ex.getMessage(),Severity.WARNING);
}
@ExceptionHandler(Exception.class)

View File

@@ -52,7 +52,6 @@ public class RestMindmap {
public RestMindmap() throws WiseMappingException {
this(new Mindmap(), null);
}
public RestMindmap(@NotNull Mindmap mindmap, @Nullable Collaborator collaborator) throws WiseMappingException {

View File

@@ -84,7 +84,7 @@ public class TransformView extends AbstractView {
// Write the conversion content ...
final ServletOutputStream outputStream = response.getOutputStream();
if (exportFormat == ExportFormat.FREEMIND) {
response.setCharacterEncoding("iso-8859-1");
response.setCharacterEncoding("ASCII");
factory.export(properties, content, outputStream, null);
} else if (exportFormat == ExportFormat.WISEMAPPING) {
response.setCharacterEncoding("UTF-8");