syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [01/17] syncope git commit: [SYNCOPE-701] Removing unwanted core/misc dependency
Date Wed, 09 Mar 2016 11:52:37 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 8557d2acf -> 28569df55


[SYNCOPE-701] Removing unwanted core/misc dependency


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/0d09829e
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/0d09829e
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/0d09829e

Branch: refs/heads/master
Commit: 0d09829ed34b62b942ed68216e8b08ffd8861335
Parents: 8557d2a
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Mar 8 16:27:57 2016 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Wed Mar 9 12:41:03 2016 +0100

----------------------------------------------------------------------
 client/enduser/pom.xml                          |  9 +-------
 .../enduser/SyncopeEnduserApplication.java      | 24 ++++++++++----------
 .../enduser/resources/AbstractBaseResource.java |  3 +++
 .../client/enduser/resources/InfoResource.java  |  5 ++--
 .../client/enduser/resources/LoginResource.java |  9 ++------
 .../enduser/resources/SchemaResource.java       |  3 +--
 .../resources/SecurityQuestionResource.java     |  5 ++--
 .../resources/SyncopeAnyClassTypeResource.java  |  5 ++--
 .../resources/SyncopeAnyTypeResource.java       |  3 +--
 .../enduser/resources/SyncopeGroupResource.java |  3 +--
 .../resources/SyncopeResourceResource.java      |  3 +--
 .../resources/UserSelfCreateResource.java       |  9 ++++----
 .../enduser/resources/UserSelfReadResource.java |  3 +--
 .../resources/UserSelfUpdateResource.java       |  9 +++-----
 14 files changed, 36 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/pom.xml
----------------------------------------------------------------------
diff --git a/client/enduser/pom.xml b/client/enduser/pom.xml
index f6132cb..eca2124 100644
--- a/client/enduser/pom.xml
+++ b/client/enduser/pom.xml
@@ -38,13 +38,6 @@ under the License.
   </properties>
   
   <dependencies>
-    
-    <dependency>
-      <groupId>org.apache.syncope.core</groupId>
-      <artifactId>syncope-core-misc</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-
     <dependency> 
       <groupId>javax.servlet</groupId> 
       <artifactId>javax.servlet-api</artifactId>
@@ -175,7 +168,7 @@ under the License.
       <groupId>org.webjars</groupId>
       <artifactId>jquery-ui</artifactId>
     </dependency>
-    
+
     <!--Logging-->
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index 2c6f348..9a3e32e 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -52,7 +52,7 @@ import org.apache.wicket.request.Request;
 import org.apache.wicket.request.Response;
 import org.apache.wicket.request.resource.IResource;
 import org.apache.wicket.request.resource.ResourceReference;
-import org.springframework.util.Assert;
+import org.apache.wicket.util.lang.Args;
 
 public class SyncopeEnduserApplication extends WebApplication implements Serializable {
 
@@ -105,30 +105,30 @@ public class SyncopeEnduserApplication extends WebApplication implements
Seriali
             throw new WicketRuntimeException("Could not read " + ENDUSER_PROPERTIES, e);
         }
         version = props.getProperty("version");
-        Assert.notNull(version, "<version> not set");
+        Args.notNull(version, "<version> not set");
         site = props.getProperty("site");
-        Assert.notNull(site, "<site> not set");
+        Args.notNull(site, "<site> not set");
         license = props.getProperty("license");
-        Assert.notNull(license, "<license> not set");
+        Args.notNull(license, "<license> not set");
         anonymousUser = props.getProperty("anonymousUser");
-        Assert.notNull(anonymousUser, "<anonymousUser> not set");
+        Args.notNull(anonymousUser, "<anonymousUser> not set");
         anonymousKey = props.getProperty("anonymousKey");
-        Assert.notNull(anonymousKey, "<anonymousKey> not set");
+        Args.notNull(anonymousKey, "<anonymousKey> not set");
 
         captchaEnabled = Boolean.parseBoolean(props.getProperty("captcha"));
-        Assert.notNull(captchaEnabled, "<captcha> not set");
+        Args.notNull(captchaEnabled, "<captcha> not set");
 
         xsrfEnabled = Boolean.parseBoolean(props.getProperty("xsrf"));
-        Assert.notNull(xsrfEnabled, "<xsrf> not set");
+        Args.notNull(xsrfEnabled, "<xsrf> not set");
 
         String scheme = props.getProperty("scheme");
-        Assert.notNull(scheme, "<scheme> not set");
+        Args.notNull(scheme, "<scheme> not set");
         String host = props.getProperty("host");
-        Assert.notNull(host, "<host> not set");
+        Args.notNull(host, "<host> not set");
         String port = props.getProperty("port");
-        Assert.notNull(port, "<port> not set");
+        Args.notNull(port, "<port> not set");
         String rootPath = props.getProperty("rootPath");
-        Assert.notNull(rootPath, "<rootPath> not set");
+        Args.notNull(rootPath, "<rootPath> not set");
 
         clientFactory = new SyncopeClientFactoryBean().setAddress(scheme + "://" + host +
":" + port + "/" + rootPath);
         clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.JSON);

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
index 6c402db..a5ebe63 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.enduser.resources;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import javax.servlet.http.HttpServletRequest;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.enduser.SyncopeEnduserApplication;
@@ -34,6 +35,8 @@ public abstract class AbstractBaseResource extends AbstractResource {
 
     private static final Logger LOG = LoggerFactory.getLogger(AbstractBaseResource.class);
 
+    protected static final ObjectMapper MAPPER = new ObjectMapper();
+
     protected final boolean isSelfRegistrationAllowed() {
         Boolean result = null;
         try {

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java
index acfbac9..8b36907 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java
@@ -25,7 +25,6 @@ import org.apache.syncope.client.enduser.SyncopeEnduserConstants;
 import org.apache.syncope.client.enduser.SyncopeEnduserSession;
 import org.apache.syncope.client.enduser.adapters.PlatformInfoAdapter;
 import org.apache.syncope.client.enduser.util.SaltGenerator;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.resource.IResource;
 import org.apache.wicket.util.cookies.CookieUtils;
 import org.slf4j.Logger;
@@ -57,9 +56,9 @@ public class InfoResource extends AbstractBaseResource {
                 @Override
                 public void writeData(final IResource.Attributes attributes) throws IOException
{
                     attributes.getResponse().write(
-                            POJOHelper.serialize(
+                            MAPPER.writeValueAsString(
                                     PlatformInfoAdapter.toPlatformInfoRequest(
-                                    SyncopeEnduserSession.get().getPlatformInfo())));
+                                            SyncopeEnduserSession.get().getPlatformInfo())));
                 }
             });
             response.setStatusCode(Response.Status.OK.getStatusCode());

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/LoginResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/LoginResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/LoginResource.java
index 28d19a3..db99669 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/LoginResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/LoginResource.java
@@ -24,7 +24,6 @@ import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.enduser.model.Credentials;
 import org.apache.syncope.client.enduser.SyncopeEnduserSession;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.resource.AbstractResource;
 import org.apache.wicket.request.resource.IResource;
 import org.apache.wicket.util.io.IOUtils;
@@ -37,12 +36,8 @@ public class LoginResource extends AbstractBaseResource {
 
     private static final Logger LOG = LoggerFactory.getLogger(LoginResource.class);
 
-    public LoginResource() {
-    }
-
     @Override
     protected ResourceResponse newResourceResponse(final IResource.Attributes attributes)
{
-
         AbstractResource.ResourceResponse response = new AbstractResource.ResourceResponse();
 
         try {
@@ -54,8 +49,8 @@ public class LoginResource extends AbstractBaseResource {
                 return response;
             }
 
-            Credentials credentials = POJOHelper.deserialize(IOUtils.toString(request.getInputStream()),
-                    Credentials.class);
+            Credentials credentials = MAPPER.readValue(
+                    IOUtils.toString(request.getInputStream()), Credentials.class);
             final String username = credentials.getUsername();
             final String password = credentials.getPassword().isEmpty() ? null : credentials.getPassword();
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
index 4783b79..3b32d05 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
@@ -34,7 +34,6 @@ import org.apache.syncope.common.lib.types.SchemaType;
 import org.apache.syncope.common.rest.api.beans.SchemaQuery;
 import org.apache.syncope.common.rest.api.service.AnyTypeService;
 import org.apache.syncope.common.rest.api.service.SchemaService;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.resource.AbstractResource;
 import org.apache.wicket.request.resource.IResource;
 import org.slf4j.Logger;
@@ -94,7 +93,7 @@ public class SchemaResource extends AbstractBaseResource {
 
                 @Override
                 public void writeData(final IResource.Attributes attributes) throws IOException
{
-                    attributes.getResponse().write(POJOHelper.serialize(new SchemaResponse().
+                    attributes.getResponse().write(MAPPER.writeValueAsString(new SchemaResponse().
                             plainSchemas(plainSchemas).
                             derSchemas(derSchemas).
                             virSchemas(virSchemas)));

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SecurityQuestionResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SecurityQuestionResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SecurityQuestionResource.java
index 7e79b1b..0893c22 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SecurityQuestionResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SecurityQuestionResource.java
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.apache.syncope.client.enduser.SyncopeEnduserSession;
 import org.apache.syncope.common.lib.to.SecurityQuestionTO;
 import org.apache.syncope.common.rest.api.service.SecurityQuestionService;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.request.resource.AbstractResource;
 import org.apache.wicket.request.resource.IResource;
@@ -72,7 +71,7 @@ public class SecurityQuestionResource extends AbstractBaseResource {
 
                     @Override
                     public void writeData(final IResource.Attributes attributes) throws IOException
{
-                        attributes.getResponse().write(POJOHelper.serialize(securityQuestionTO));
+                        attributes.getResponse().write(MAPPER.writeValueAsString(securityQuestionTO));
                     }
                 });
             } else {
@@ -82,7 +81,7 @@ public class SecurityQuestionResource extends AbstractBaseResource {
 
                     @Override
                     public void writeData(final IResource.Attributes attributes) throws IOException
{
-                        attributes.getResponse().write(POJOHelper.serialize(securityQuestionTOs));
+                        attributes.getResponse().write(MAPPER.writeValueAsString(securityQuestionTOs));
                     }
                 });
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyClassTypeResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyClassTypeResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyClassTypeResource.java
index 2528150..bdb6f98 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyClassTypeResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyClassTypeResource.java
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.apache.syncope.client.enduser.SyncopeEnduserSession;
 import org.apache.syncope.common.lib.to.AnyTypeClassTO;
 import org.apache.syncope.common.rest.api.service.AnyTypeClassService;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.resource.AbstractResource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -38,7 +37,7 @@ public class SyncopeAnyClassTypeResource extends AbstractBaseResource {
 
     private final AnyTypeClassService anyTypeClassService;
 
-    public SyncopeAnyClassTypeResource() {        
+    public SyncopeAnyClassTypeResource() {
         anyTypeClassService = SyncopeEnduserSession.get().getService(AnyTypeClassService.class);
     }
 
@@ -64,7 +63,7 @@ public class SyncopeAnyClassTypeResource extends AbstractBaseResource {
 
                 @Override
                 public void writeData(final Attributes attributes) throws IOException {
-                    attributes.getResponse().write(POJOHelper.serialize(anyTypeClassTOs));
+                    attributes.getResponse().write(MAPPER.writeValueAsString(anyTypeClassTOs));
                 }
             });
             response.setStatusCode(Response.Status.OK.getStatusCode());

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyTypeResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyTypeResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyTypeResource.java
index 7d2bcde..9c9b1ad 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyTypeResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeAnyTypeResource.java
@@ -24,7 +24,6 @@ import javax.ws.rs.core.Response;
 import org.apache.syncope.client.enduser.SyncopeEnduserSession;
 import org.apache.syncope.common.lib.to.AnyTypeTO;
 import org.apache.syncope.common.rest.api.service.AnyTypeService;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.resource.AbstractResource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,7 +63,7 @@ public class SyncopeAnyTypeResource extends AbstractBaseResource {
 
                 @Override
                 public void writeData(final Attributes attributes) throws IOException {
-                    attributes.getResponse().write(POJOHelper.serialize(anyTypeTO));
+                    attributes.getResponse().write(MAPPER.writeValueAsString(anyTypeTO));
                 }
             });
             response.setStatusCode(Response.Status.OK.getStatusCode());

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeGroupResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeGroupResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeGroupResource.java
index 8ae82ce..09e3b85 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeGroupResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeGroupResource.java
@@ -27,7 +27,6 @@ import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.GroupTO;
 import org.apache.syncope.common.rest.api.beans.AnyListQuery;
 import org.apache.syncope.common.rest.api.service.GroupService;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.resource.AbstractResource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -69,7 +68,7 @@ public class SyncopeGroupResource extends AbstractBaseResource {
 
                 @Override
                 public void writeData(final Attributes attributes) throws IOException {
-                    attributes.getResponse().write(POJOHelper.serialize(groupTOs));
+                    attributes.getResponse().write(MAPPER.writeValueAsString(groupTOs));
                 }
             });
             response.setStatusCode(Response.Status.OK.getStatusCode());

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeResourceResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeResourceResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeResourceResource.java
index 8d08ac2..8a6d0a9 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeResourceResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SyncopeResourceResource.java
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.apache.syncope.client.enduser.SyncopeEnduserSession;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.rest.api.service.ResourceService;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.resource.AbstractResource;
 import org.apache.wicket.request.resource.IResource;
 import org.slf4j.Logger;
@@ -65,7 +64,7 @@ public class SyncopeResourceResource extends AbstractBaseResource {
 
                 @Override
                 public void writeData(final IResource.Attributes attributes) throws IOException
{
-                    attributes.getResponse().write(POJOHelper.serialize(resourceTOs));
+                    attributes.getResponse().write(MAPPER.writeValueAsString(resourceTOs));
                 }
             });
             response.setStatusCode(Response.Status.OK.getStatusCode());

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
index 88059d6..4ab2ca5 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
@@ -25,7 +25,6 @@ import org.apache.syncope.client.enduser.SyncopeEnduserConstants;
 import org.apache.syncope.client.enduser.SyncopeEnduserSession;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.rest.api.service.UserSelfService;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -58,7 +57,7 @@ public class UserSelfCreateResource extends AbstractBaseResource {
 
             String jsonString = request.getReader().readLine();
 
-            final UserTO userTO = POJOHelper.deserialize(jsonString, UserTO.class);
+            final UserTO userTO = MAPPER.readValue(jsonString, UserTO.class);
 
             if (!captchaCheck(request.getHeader("captcha"), request.getSession().getAttribute(
                     SyncopeEnduserConstants.CAPTCHA_SESSION_KEY).toString())) {
@@ -79,7 +78,7 @@ public class UserSelfCreateResource extends AbstractBaseResource {
                         attributes.getResponse().write(res.getStatusInfo().getFamily().equals(
                                 Response.Status.Family.SUCCESSFUL)
                                         ? responseMessage.append("User: ").append(userTO.getUsername()).append(
-                                                " successfully created")
+                                        " successfully created")
                                         : new StringBuilder().append("ErrorMessage{{ ").
                                         append(res.getStatusInfo().getReasonPhrase()).append("
}}"));
                     }
@@ -88,8 +87,8 @@ public class UserSelfCreateResource extends AbstractBaseResource {
             } else {
                 response.setError(Response.Status.FORBIDDEN.getStatusCode(), new StringBuilder().
                         append("ErrorMessage{{").append(userTO == null
-                                        ? "Request received is not valid }}"
-                                        : "Self registration not allowed }}").toString());
+                        ? "Request received is not valid }}"
+                        : "Self registration not allowed }}").toString());
             }
 
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfReadResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfReadResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfReadResource.java
index 2cca020..2411adf 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfReadResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfReadResource.java
@@ -22,7 +22,6 @@ import java.io.IOException;
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.core.Response;
 import org.apache.syncope.client.enduser.SyncopeEnduserSession;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.resource.AbstractResource;
 import org.apache.wicket.request.resource.IResource;
 import org.slf4j.Logger;
@@ -56,7 +55,7 @@ public class UserSelfReadResource extends AbstractBaseResource {
                 return response;
             }
 
-            final String selfTOJson = POJOHelper.serialize(SyncopeEnduserSession.get().getSelfTO());
+            final String selfTOJson = MAPPER.writeValueAsString(SyncopeEnduserSession.get().getSelfTO());
 
             response.setWriteCallback(new WriteCallback() {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d09829e/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java
index d913e6e..8e2c148 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java
@@ -25,7 +25,6 @@ import org.apache.syncope.client.enduser.SyncopeEnduserConstants;
 import org.apache.syncope.client.enduser.SyncopeEnduserSession;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.rest.api.service.UserSelfService;
-import org.apache.syncope.core.misc.serialization.POJOHelper;
 import org.apache.wicket.request.resource.AbstractResource;
 import org.apache.wicket.request.resource.IResource;
 import org.slf4j.Logger;
@@ -39,14 +38,12 @@ public class UserSelfUpdateResource extends AbstractBaseResource {
 
     private final UserSelfService userSelfService;
 
-
     public UserSelfUpdateResource() {
         userSelfService = SyncopeEnduserSession.get().getService(UserSelfService.class);
     }
 
     @Override
     protected ResourceResponse newResourceResponse(final IResource.Attributes attributes)
{
-
         AbstractResource.ResourceResponse response = new AbstractResource.ResourceResponse();
 
         try {
@@ -59,14 +56,14 @@ public class UserSelfUpdateResource extends AbstractBaseResource {
 
             String jsonString = request.getReader().readLine();
 
-            final UserTO userTO = POJOHelper.deserialize(jsonString, UserTO.class);
+            final UserTO userTO = MAPPER.readValue(jsonString, UserTO.class);
 
             if (!captchaCheck(request.getHeader("captcha"), request.getSession().getAttribute(
                     SyncopeEnduserConstants.CAPTCHA_SESSION_KEY).toString())) {
                 LOG.error("Entered captcha is not matching");
                 throw new Exception("Entered captcha is not matching");
             }
-            
+
             LOG.debug("User {} id updating himself", userTO.getUsername());
 
             // update user
@@ -74,7 +71,7 @@ public class UserSelfUpdateResource extends AbstractBaseResource {
 
             final String responseMessage = res.getStatusInfo().getFamily().equals(Response.Status.Family.SUCCESSFUL)
                     ? new StringBuilder().append("User").append(userTO.getUsername()).append(
-                            " successfully updated").toString()
+                    " successfully updated").toString()
                     : new StringBuilder().append("ErrorMessage{{ ").
                     append(res.getStatusInfo().getReasonPhrase()).append(" }}").toString();
 


Mime
View raw message