diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml
index e5448334..40cc3c0a 100644
--- a/wise-webapp/pom.xml
+++ b/wise-webapp/pom.xml
@@ -135,7 +135,7 @@
${org.springframework.version}
compile
-
+
org.springframework.security
spring-security-config
${org.springframework.version}
@@ -250,6 +250,17 @@
1.8.0.10
runtime
+
+ org.codehaus.jackson
+ jackson-core-asl
+ 1.9.4
+
+
+
+ org.codehaus.jackson
+ jackson-mapper-asl
+ 1.9.4
+
@@ -418,6 +429,8 @@
8.1.0.v20120127
${project.build.directory}/wisemapping.war
+ automatic
+ 10
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java
new file mode 100644
index 00000000..c241a71b
--- /dev/null
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java
@@ -0,0 +1,44 @@
+package com.wisemapping.rest;
+
+
+import com.wisemapping.model.MindMap;
+import com.wisemapping.service.MindmapService;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+@Controller
+public class MindmapController {
+ private MindmapService mindmapService;
+
+ public void setMindmapService(MindmapService mindmapService) {
+ this.mindmapService = mindmapService;
+ }
+
+ @RequestMapping(method = RequestMethod.GET, value = "/map/{id}")
+ public
+ @ResponseBody
+ Map getMindmap(@PathVariable int id) throws IOException {
+ final Map result = new HashMap();
+ final MindMap mindMap = mindmapService.getMindmapById(id);
+ result.put("xml", mindMap.getNativeXml());
+ result.put("creationTime", mindMap.getCreationTime());
+ result.put("description", mindMap.getDescription());
+ result.put("lastModification", mindMap.getLastModificationDate());
+ result.put("owner", mindMap.getOwner().getUsername());
+ return result;
+ }
+
+ @RequestMapping(method = RequestMethod.POST, value = "/map/{id}")
+ public void updateMindmap(@PathVariable int id) throws IOException {
+
+ }
+
+
+}
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java b/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java
deleted file mode 100644
index 76e18a88..00000000
--- a/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.wisemapping.rest;
-
-
-import com.wisemapping.model.User;
-import org.jetbrains.annotations.NotNull;
-import org.springframework.oxm.jaxb.Jaxb2Marshaller;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.servlet.ModelAndView;
-
-@Controller
-public class UserController {
- private Jaxb2Marshaller jaxb2Mashaller;
-
- public void setJaxb2Mashaller(@NotNull final Jaxb2Marshaller jaxb2Mashaller) {
- this.jaxb2Mashaller = jaxb2Mashaller;
- }
-
- private static final String XML_VIEW_NAME = "users";
-
- @RequestMapping(method = RequestMethod.GET, value = "/employee/{id}")
- public ModelAndView getEmployee(@PathVariable String id) {
- User user = new User();
- return new ModelAndView(XML_VIEW_NAME, "object", user);
- }
-
-
-}
diff --git a/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java b/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java
index 7fcc5180..db861554 100644
--- a/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java
+++ b/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java
@@ -21,6 +21,7 @@ public class AuthenticationProvider implements org.springframework.security.auth
public Authentication authenticate(@NotNull final Authentication auth) throws AuthenticationException {
// All your user authentication needs
+
final String email = auth.getName();
final User user = userManager.getUserBy(email);
final String credentials = (String) auth.getCredentials();
diff --git a/wise-webapp/src/main/java/com/wisemapping/security/CustomPasswordEncoder.java b/wise-webapp/src/main/java/com/wisemapping/security/CustomPasswordEncoder.java
index e1d9092c..b10f0219 100755
--- a/wise-webapp/src/main/java/com/wisemapping/security/CustomPasswordEncoder.java
+++ b/wise-webapp/src/main/java/com/wisemapping/security/CustomPasswordEncoder.java
@@ -25,8 +25,7 @@ import org.springframework.security.authentication.encoding.PasswordEncoder;
import org.springframework.security.authentication.encoding.ShaPasswordEncoder;
public class CustomPasswordEncoder
- implements PasswordEncoder
-{
+ implements PasswordEncoder {
private PasswordEncoder delegateEncoder = new ShaPasswordEncoder();
private static final String ENC_PREFIX = "ENC:";
@@ -34,9 +33,8 @@ public class CustomPasswordEncoder
public String encodePassword(@NotNull String rawPass, @Nullable Object salt) throws DataAccessException {
String password = rawPass;
- if (!rawPass.startsWith(ENC_PREFIX))
- {
- password = ENC_PREFIX + delegateEncoder.encodePassword(rawPass,salt);
+ if (!rawPass.startsWith(ENC_PREFIX)) {
+ password = ENC_PREFIX + delegateEncoder.encodePassword(rawPass, salt);
}
return password;
@@ -47,11 +45,10 @@ public class CustomPasswordEncoder
String pass1 = "" + encPass;
String pass2 = rawPass;
- if (pass1.startsWith(ENC_PREFIX))
- {
+ if (pass1.startsWith(ENC_PREFIX)) {
pass2 = encodePassword(rawPass, salt);
}
- return pass1.equals(pass2);
+ return pass1.equals(pass2);
}
}
diff --git a/wise-webapp/src/main/java/com/wisemapping/security/DatabaseUserDetailService.java b/wise-webapp/src/main/java/com/wisemapping/security/UserDetailService.java
similarity index 91%
rename from wise-webapp/src/main/java/com/wisemapping/security/DatabaseUserDetailService.java
rename to wise-webapp/src/main/java/com/wisemapping/security/UserDetailService.java
index e5fd5e7a..4a83a481 100644
--- a/wise-webapp/src/main/java/com/wisemapping/security/DatabaseUserDetailService.java
+++ b/wise-webapp/src/main/java/com/wisemapping/security/UserDetailService.java
@@ -21,11 +21,11 @@ package com.wisemapping.security;
import com.wisemapping.dao.UserManager;
import org.jetbrains.annotations.NotNull;
import org.springframework.dao.DataAccessException;
-import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
-public class DatabaseUserDetailService
- implements UserDetailsService {
+
+public class UserDetailService
+ implements org.springframework.security.core.userdetails.UserDetailsService {
private UserManager userManager;
@Override
diff --git a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/users.jsp b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/map.jsp
similarity index 100%
rename from wise-webapp/src/main/webapp/WEB-INF/jsp-rest/users.jsp
rename to wise-webapp/src/main/webapp/WEB-INF/jsp-rest/map.jsp
diff --git a/wise-webapp/src/main/webapp/WEB-INF/web.xml b/wise-webapp/src/main/webapp/WEB-INF/web.xml
index 3c3a7ab2..608b0682 100644
--- a/wise-webapp/src/main/webapp/WEB-INF/web.xml
+++ b/wise-webapp/src/main/webapp/WEB-INF/web.xml
@@ -44,10 +44,6 @@
-
- charsetFilter
- /*
-
hibernate
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
@@ -60,6 +56,7 @@
mindmapSessionFactory
+
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
@@ -75,6 +72,12 @@
/*
+
+ charsetFilter
+ /*
+
+
+
org.springframework.web.context.ContextLoaderListener
diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-acegi-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-acegi-security.xml
index 351e84cb..0359e3ea 100644
--- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-acegi-security.xml
+++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-acegi-security.xml
@@ -157,7 +157,7 @@
-
+
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 ea5db949..6a4277a3 100644
--- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml
+++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml
@@ -12,25 +12,13 @@
-
-
-
-
-
- com.wisemapping.model.User
-
-
-
-
-
-
-
@@ -39,16 +27,42 @@
-
+
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ java.util.HashMap
+
+
+
+
+
+
+
\ No newline at end of file
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 26b75537..6ed011bf 100644
--- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml
+++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml
@@ -11,11 +11,11 @@
-
-
-
+
+
+
-
+
@@ -23,28 +23,30 @@
-
+
-
-
+
+
+
+
+
-
+
+
-
-
-
-
+
@@ -54,8 +56,20 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file