syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbernha...@apache.org
Subject svn commit: r1416823 [1/2] - in /syncope/branches/cxf/common: ./ src/main/java/org/apache/syncope/ src/main/java/org/apache/syncope/annotation/ src/main/java/org/apache/syncope/controller/ src/main/java/org/apache/syncope/exceptions/ src/main/java/org/...
Date Tue, 04 Dec 2012 08:55:11 GMT
Author: jbernhardt
Date: Tue Dec  4 08:55:06 2012
New Revision: 1416823

URL: http://svn.apache.org/viewvc?rev=1416823&view=rev
Log:
Checkin JAX-RS annotated Role and User Service Interface, as well as JAXB annotated TO Classes.

Added:
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/ContextAware.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/RoleService.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/UserService.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/exceptions/
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/exceptions/RestHttpStatusCodeMapper.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/validation/InvalidEntityException.java
Removed:
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/RoleController.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/UserController.java
Modified:
    syncope/branches/cxf/common/pom.xml
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/NotFoundException.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/FormAttributeField.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/SchemaList.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AbstractAttributableMod.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AttributeMod.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/MembershipMod.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/ReferenceMod.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/RoleMod.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/UserMod.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/AttributeCond.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/MembershipCond.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/NodeCond.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/ResourceCond.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/SyncopeUserCond.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AbstractAttributableTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AttributeTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConfigurationTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnBundleTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnInstanceTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnObjectTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/DerivedSchemaTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/LoggerTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/MembershipTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTaskTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PasswordPolicyTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PolicyTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTaskTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportExecTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ResourceTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/RoleTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchedTaskTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaMappingTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncPolicyTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncTaskTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskExecTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserRequestTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/VirtualSchemaTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowDefinitionTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormPropertyTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormTO.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/PropagationTaskExecStatus.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/WorkflowFormPropertyType.java
    syncope/branches/cxf/common/src/main/java/org/apache/syncope/util/AttributableOperations.java

Modified: syncope/branches/cxf/common/pom.xml
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/pom.xml?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/pom.xml (original)
+++ syncope/branches/cxf/common/pom.xml Tue Dec  4 08:55:06 2012
@@ -1,24 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+  license agreements. See the NOTICE file distributed with this work for additional 
+  information regarding copyright ownership. The ASF licenses this file to 
+  you under the Apache License, Version 2.0 (the "License"); you may not use 
+  this file except in compliance with the License. You may obtain a copy of 
+  the License at http://www.apache.org/licenses/LICENSE-2.0 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. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
   <modelVersion>4.0.0</modelVersion>
 
@@ -41,22 +33,22 @@ under the License.
       <url>${site.deploymentBaseUrl}/${project.artifactId}</url>
     </site>
   </distributionManagement>
-  
+
   <dependencies>
-<dependency>
+    <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
     </dependency>
-<dependency>
+    <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-webmvc</artifactId>
     </dependency>
-	
-  
-  <dependency>
+
+    <dependency>
       <groupId>org.apache.cxf</groupId>
       <artifactId>cxf-rt-frontend-jaxrs</artifactId>
     </dependency>
+
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-tx</artifactId>
@@ -65,29 +57,29 @@ under the License.
       <groupId>org.springframework.security</groupId>
       <artifactId>spring-security-core</artifactId>
     </dependency>
-    
-	<dependency>
+
+    <dependency>
       <groupId>org.codehaus.jackson</groupId>
       <artifactId>jackson-mapper-asl</artifactId>
     </dependency>
-	
-	<dependency>
+
+    <dependency>
       <groupId>com.thoughtworks.xstream</groupId>
       <artifactId>xstream</artifactId>
     </dependency>
 
-	<dependency>
+    <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
     </dependency>
-	
+
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
-	
-	<dependency>
+
+    <dependency>
       <groupId>ch.qos.logback</groupId>
       <artifactId>logback-core</artifactId>
     </dependency>
@@ -96,11 +88,24 @@ under the License.
       <artifactId>logback-classic</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+
   </dependencies>
 
   <build>
     <plugins>
       <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
         <extensions>true</extensions>
@@ -119,8 +124,8 @@ under the License.
               org.springframework*;version="[3,4)",
               ch.qos.logback.classic;resolution:=optional,
               org.slf4j;resolution:=optional,
-			  *
-			  </Import-Package>
+              *
+            </Import-Package>
           </instructions>
         </configuration>
       </plugin>
@@ -133,17 +138,6 @@ under the License.
         <artifactId>maven-pmd-plugin</artifactId>
       </plugin>
     </plugins>
-    
-    <resources>
-      <resource>
-        <directory>..</directory>
-        <targetPath>META-INF</targetPath>
-        <includes>
-          <include>LICENSE</include>
-          <include>NOTICE</include>
-          <include>DISCLAIMER</include>
-        </includes>
-      </resource>
-    </resources>
+
   </build>
 </project>

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/NotFoundException.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/NotFoundException.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/NotFoundException.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/NotFoundException.java Tue Dec  4 08:55:06 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope;
 
+
 /**
  * Thrown when something is not found.
  */

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/FormAttributeField.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/FormAttributeField.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/FormAttributeField.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/FormAttributeField.java Tue Dec  4 08:55:06 2012
@@ -22,6 +22,7 @@ import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
+
 import org.apache.syncope.types.IntMappingType;
 
 @Target( { ElementType.FIELD })

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/SchemaList.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/SchemaList.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/SchemaList.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/annotation/SchemaList.java Tue Dec  4 08:55:06 2012
@@ -18,9 +18,10 @@
  */
 package org.apache.syncope.annotation;
 
-import java.lang.annotation.Retention;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
+import java.lang.annotation.Retention;
+
 @Retention(RUNTIME)
 public @interface SchemaList {
 

Added: syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/ContextAware.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/ContextAware.java?rev=1416823&view=auto
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/ContextAware.java (added)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/ContextAware.java Tue Dec  4 08:55:06 2012
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+package org.apache.syncope.controller;
+
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+
+public interface ContextAware {
+
+    @Context
+    public void setUriInfo(UriInfo ui);
+}

Added: syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/RoleService.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/RoleService.java?rev=1416823&view=auto
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/RoleService.java (added)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/RoleService.java Tue Dec  4 08:55:06 2012
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+package org.apache.syncope.controller;
+
+import java.util.List;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Response;
+
+import org.apache.syncope.NotFoundException;
+import org.apache.syncope.mod.RoleMod;
+import org.apache.syncope.to.RoleTO;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+
+@Path("/role")
+public interface RoleService {
+
+    @GET
+    @Path("/{roleId}")
+    @PreAuthorize("isAuthenticated()")
+    @Transactional(readOnly = true)
+    public RoleTO read(@PathParam("roleId") final Long roleId) throws NotFoundException,
+            UnauthorizedRoleException;
+
+    @GET
+    @Path("/{roleId}/parent")
+    @PreAuthorize("hasRole('ROLE_READ')")
+    @Transactional(readOnly = true)
+    public RoleTO parent(@PathParam("roleId") final Long roleId) throws NotFoundException,
+            UnauthorizedRoleException;
+
+    @GET
+    @Path("/{roleId}/children")
+    @PreAuthorize("hasRole('ROLE_READ')")
+    @Transactional(readOnly = true)
+    public List<RoleTO> children(@PathParam("roleId") final Long roleId) throws NotFoundException;
+
+    @GET
+    @PreAuthorize("hasRole('ROLE_READ')")
+    @Transactional(readOnly = true)
+    public List<RoleTO> list();
+
+    @POST
+    @Path("/")
+    @PreAuthorize("hasRole('ROLE_CREATE')")
+    public Response create(final RoleTO roleTO)
+            throws UnauthorizedRoleException;
+
+    @PUT
+    @Path("/{roleId}")
+    @PreAuthorize("hasRole('ROLE_UPDATE')")
+    public RoleTO update(@PathParam("roleId") final Long roleId, final RoleMod roleMod)
+            throws NotFoundException, UnauthorizedRoleException;
+
+    @DELETE
+    @Path("/{roleId}")
+    @PreAuthorize("hasRole('ROLE_DELETE')")
+    public Response delete(@PathParam("roleId") final Long roleId) throws NotFoundException,
+            UnauthorizedRoleException;
+
+}
\ No newline at end of file

Added: syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/UserService.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/UserService.java?rev=1416823&view=auto
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/UserService.java (added)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/controller/UserService.java Tue Dec  4 08:55:06 2012
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+package org.apache.syncope.controller;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+
+import org.apache.syncope.mod.UserMod;
+import org.apache.syncope.search.NodeCond;
+import org.apache.syncope.to.UserTO;
+import org.apache.syncope.to.WorkflowFormTO;
+import org.apache.syncope.propagation.PropagationException;
+import org.apache.syncope.controller.InvalidSearchConditionException;
+import org.apache.syncope.controller.UnauthorizedRoleException;
+import org.apache.syncope.NotFoundException;
+import org.apache.syncope.workflow.WorkflowException;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+
+@Path("/user")
+public interface UserService {
+
+    @GET
+    @PreAuthorize("hasRole('USER_READ')")
+    @Transactional(readOnly = true)
+    public abstract Boolean verifyPassword(@QueryParam("uname") String username,
+            @QueryParam("pw") final String password);
+
+    @GET
+    @Path("/count")
+    @PreAuthorize("hasRole('USER_LIST')")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public abstract int count();
+
+    @POST
+    @Path("/count")
+    @PreAuthorize("hasRole('USER_READ')")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public abstract int searchCount(final NodeCond searchCondition) throws InvalidSearchConditionException;
+
+    @GET
+    @PreAuthorize("hasRole('USER_LIST')")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public abstract List<UserTO> list();
+
+    @GET
+    @PreAuthorize("hasRole('USER_LIST')")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public abstract List<UserTO> list(@QueryParam("page") final int page,
+            @QueryParam("size") @DefaultValue("25") final int size);
+
+    @GET
+    @Path("/{userId}")
+    @PreAuthorize("hasRole('USER_READ')")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public abstract UserTO read(@PathParam("userId") final Long userId) throws NotFoundException,
+            UnauthorizedRoleException;
+
+    @GET
+    @PreAuthorize("hasRole('USER_READ')")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public abstract UserTO read(@QueryParam("uname") final String username) throws NotFoundException,
+            UnauthorizedRoleException;
+
+    @POST
+    @Path("search")
+    @PreAuthorize("hasRole('USER_READ')")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public abstract List<UserTO> search(final NodeCond searchCondition)
+            throws InvalidSearchConditionException;
+
+    @POST
+    @Path("search")
+    @PreAuthorize("hasRole('USER_READ')")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public abstract List<UserTO> search(final NodeCond searchCondition, @QueryParam("page") final int page,
+            @QueryParam("size") @DefaultValue("25") final int size) throws InvalidSearchConditionException;
+
+    @POST
+    @Path("/")
+    @PreAuthorize("hasRole('USER_CREATE')")
+    public abstract Response create(final UserTO userTO) throws PropagationException,
+            UnauthorizedRoleException, WorkflowException, NotFoundException;
+
+    @PUT
+    @Path("/{userId}")
+    @PreAuthorize("hasRole('USER_UPDATE')")
+    public abstract UserTO update(final UserMod userMod) throws NotFoundException, PropagationException,
+            UnauthorizedRoleException, WorkflowException;
+
+    @PUT
+    @Path("/user/{userId}/status/active")
+    @PreAuthorize("hasRole('USER_UPDATE')")
+    @Transactional(rollbackFor = { Throwable.class })
+    public abstract UserTO activate(@PathParam("userId") final Long userId,
+            @FormParam("token") final String token,
+            @FormParam("resourceNames") final Set<String> resourceNames,
+            @FormParam("performLocally") @DefaultValue("true") final Boolean performLocally,
+            @FormParam("performRemotely") @DefaultValue("true") final Boolean performRemotely)
+            throws WorkflowException, NotFoundException, UnauthorizedRoleException, PropagationException;
+
+    @DELETE
+    @Path("/user/{userId}/status/active")
+    @PreAuthorize("hasRole('USER_UPDATE')")
+    @Transactional(rollbackFor = { Throwable.class })
+    public abstract UserTO suspend(@PathParam("userId") final Long userId,
+            @FormParam("resourceNames") final Set<String> resourceNames,
+            @FormParam("performLocally") @DefaultValue("true") final Boolean performLocally,
+            @FormParam("performRemotely") @DefaultValue("true") final Boolean performRemotely)
+            throws NotFoundException, WorkflowException, UnauthorizedRoleException, PropagationException;
+
+    @DELETE
+    @Path("/{userId}")
+    @PreAuthorize("hasRole('USER_DELETE')")
+    public abstract Response delete(@PathParam("userId") final Long userId) throws NotFoundException,
+            WorkflowException, PropagationException, UnauthorizedRoleException;
+
+    @POST
+    @Path("/workflow/task/{taskId}/execute")
+    @PreAuthorize("hasRole('USER_UPDATE')")
+    public abstract UserTO executeWorkflow(@PathParam("taskId") final String taskId, final UserTO userTO)
+            throws WorkflowException, NotFoundException, UnauthorizedRoleException, PropagationException;
+
+    @GET
+    @Path("/workflow/form")
+    @PreAuthorize("hasRole('WORKFLOW_FORM_LIST')")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public abstract List<WorkflowFormTO> getForms();
+
+    @GET
+    @Path("/{userId}/workflow/form")
+    @PreAuthorize("hasRole('WORKFLOW_FORM_READ') and hasRole('USER_READ')")
+    @Transactional(rollbackFor = { Throwable.class })
+    public abstract WorkflowFormTO getFormForUser(@PathParam("userId") final Long userId)
+            throws UnauthorizedRoleException, NotFoundException, WorkflowException;
+
+    @POST
+    @Path("/workflow/task/{taskId}/claim")
+    @PreAuthorize("hasRole('WORKFLOW_FORM_CLAIM')")
+    @Transactional(rollbackFor = { Throwable.class })
+    public abstract WorkflowFormTO claimForm(@PathParam("taskId") final String taskId)
+            throws NotFoundException, WorkflowException;
+
+    @POST
+    @Path("/workflow/form")
+    @PreAuthorize("hasRole('WORKFLOW_FORM_SUBMIT')")
+    @Transactional(rollbackFor = { Throwable.class })
+    public abstract UserTO submitForm(final WorkflowFormTO form) throws NotFoundException, WorkflowException,
+            PropagationException, UnauthorizedRoleException;
+}
\ No newline at end of file

Added: syncope/branches/cxf/common/src/main/java/org/apache/syncope/exceptions/RestHttpStatusCodeMapper.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/exceptions/RestHttpStatusCodeMapper.java?rev=1416823&view=auto
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/exceptions/RestHttpStatusCodeMapper.java (added)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/exceptions/RestHttpStatusCodeMapper.java Tue Dec  4 08:55:06 2012
@@ -0,0 +1,65 @@
+package org.apache.syncope.exceptions;
+
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+
+import org.apache.cxf.jaxrs.client.ResponseExceptionMapper;
+import org.apache.http.HttpStatus;
+import org.apache.syncope.NotFoundException;
+import org.apache.syncope.controller.UnauthorizedRoleException;
+import org.apache.syncope.validation.InvalidEntityException;
+import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.security.access.AccessDeniedException;
+
+@Provider
+public class RestHttpStatusCodeMapper implements ExceptionMapper<Exception>,
+        ResponseExceptionMapper<Exception> {
+
+    @Override
+    public Response toResponse(Exception e) {
+
+        String errorMsg = e.getMessage();
+//        if (e.getCause() != null && e.getCause().getMessage() != null)
+//            errorMsg += "\n" + e.getCause().getMessage();
+
+        if (e instanceof DataIntegrityViolationException)
+            errorMsg = e.getClass().getCanonicalName() + "\n" + e.getCause().toString();
+
+        if (e instanceof NotFoundException)
+            return Response.status(Response.Status.NOT_FOUND).entity(errorMsg)
+                    .type(MediaType.TEXT_PLAIN_TYPE).build();
+        if (e instanceof AccessDeniedException)
+            return Response.status(Response.Status.UNAUTHORIZED)
+                    .header(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=\"Spring Security Application\"")
+                    .entity(errorMsg).type(MediaType.TEXT_PLAIN_TYPE).build();
+        if (e instanceof UnauthorizedRoleException)
+            return Response.status(Response.Status.UNAUTHORIZED)
+                    .entity(errorMsg).type(MediaType.TEXT_PLAIN_TYPE).build();
+        if (e instanceof InvalidEntityException || e instanceof DataIntegrityViolationException)
+            return Response.status(Response.Status.BAD_REQUEST).entity(errorMsg)
+                    .type(MediaType.TEXT_PLAIN_TYPE).build();
+
+        return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorMsg)
+                .type(MediaType.TEXT_PLAIN_TYPE).build();
+    }
+
+    @Override
+    public Exception fromResponse(Response response) {
+        int statusCode = response.getStatus();
+
+        switch (statusCode) {
+        case HttpStatus.SC_NOT_FOUND:
+            return new NotFoundException(response.readEntity(String.class));
+        case HttpStatus.SC_UNAUTHORIZED:
+            // TODO find a way to enhance this error message with correct
+            // RoleNumbers.
+            return new UnauthorizedRoleException(-1L);
+        }
+
+        return null;
+    }
+
+}

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AbstractAttributableMod.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AbstractAttributableMod.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AbstractAttributableMod.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AbstractAttributableMod.java Tue Dec  4 08:55:06 2012
@@ -21,6 +21,10 @@ package org.apache.syncope.mod;
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
 /**
@@ -28,6 +32,7 @@ import org.apache.syncope.AbstractBaseBe
  *
  * Attributes can be regular attributes, derived attributes, virtual attributes and resources.
  */
+@XmlType
 public abstract class AbstractAttributableMod extends AbstractBaseBean {
 
     private static final long serialVersionUID = 3241118574016303198L;
@@ -85,6 +90,8 @@ public abstract class AbstractAttributab
         return attributesToBeRemoved.remove(attribute);
     }
 
+    @XmlElement(name = "attribute")
+    @XmlElementWrapper(name = "attributesToBeRemoved")
     public Set<String> getAttributesToBeRemoved() {
         return attributesToBeRemoved;
     }
@@ -115,6 +122,8 @@ public abstract class AbstractAttributab
         return attributesToBeUpdated.remove(attribute);
     }
 
+    @XmlElement(name = "attribute")
+    @XmlElementWrapper(name = "attributesToBeUpdated")
     public Set<AttributeMod> getAttributesToBeUpdated() {
         return attributesToBeUpdated;
     }
@@ -144,6 +153,8 @@ public abstract class AbstractAttributab
         return derivedAttributesToBeAdded.remove(derivedAttribute);
     }
 
+    @XmlElement(name = "attribute")
+    @XmlElementWrapper(name = "derivedAttributesToBeAdded")
     public Set<String> getDerivedAttributesToBeAdded() {
         return derivedAttributesToBeAdded;
     }
@@ -161,6 +172,8 @@ public abstract class AbstractAttributab
         return derivedAttributesToBeRemoved.remove(derivedAttribute);
     }
 
+    @XmlElement(name = "attribute")
+    @XmlElementWrapper(name = "derivedAttributesToBeRemoved")
     public Set<String> getDerivedAttributesToBeRemoved() {
         return derivedAttributesToBeRemoved;
     }
@@ -170,6 +183,8 @@ public abstract class AbstractAttributab
         this.derivedAttributesToBeRemoved = derivedAttributesToBeRemoved;
     }
 
+    @XmlElement(name = "attribute")
+    @XmlElementWrapper(name = "virtualAttributesToBeRemoved")
     public Set<String> getVirtualAttributesToBeRemoved() {
         return virtualAttributesToBeRemoved;
     }
@@ -199,6 +214,8 @@ public abstract class AbstractAttributab
         return virtualAttributesToBeUpdated.remove(virtualAttributeToBeUpdated);
     }
 
+    @XmlElement(name = "attribute")
+    @XmlElementWrapper(name = "virtualAttributesToBeUpdated")
     public Set<AttributeMod> getVirtualAttributesToBeUpdated() {
         return virtualAttributesToBeUpdated;
     }
@@ -216,6 +233,8 @@ public abstract class AbstractAttributab
         return resourcesToBeAdded.remove(resource);
     }
 
+    @XmlElement(name = "attribute")
+    @XmlElementWrapper(name = "resourcesToBeAdded")
     public Set<String> getResourcesToBeAdded() {
         return resourcesToBeAdded;
     }
@@ -232,6 +251,8 @@ public abstract class AbstractAttributab
         return resourcesToBeRemoved.remove(resource);
     }
 
+    @XmlElement(name = "attribute")
+    @XmlElementWrapper(name = "resourcesToBeRemoved")
     public Set<String> getResourcesToBeRemoved() {
         return resourcesToBeRemoved;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AttributeMod.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AttributeMod.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AttributeMod.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/AttributeMod.java Tue Dec  4 08:55:06 2012
@@ -20,9 +20,13 @@ package org.apache.syncope.mod;
 
 import java.util.ArrayList;
 import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.apache.syncope.AbstractBaseBean;
 
+@XmlRootElement
 public class AttributeMod extends AbstractBaseBean {
 
     private static final long serialVersionUID = -913573979137431406L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/MembershipMod.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/MembershipMod.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/MembershipMod.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/MembershipMod.java Tue Dec  4 08:55:06 2012
@@ -20,8 +20,14 @@ package org.apache.syncope.mod;
 
 import java.util.Collections;
 import java.util.Set;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.codehaus.jackson.annotate.JsonIgnore;
 
+@XmlRootElement
+@XmlType
 public class MembershipMod extends AbstractAttributableMod {
 
     private static final long serialVersionUID = 2511869129977331525L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/ReferenceMod.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/ReferenceMod.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/ReferenceMod.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/ReferenceMod.java Tue Dec  4 08:55:06 2012
@@ -18,6 +18,8 @@
  */
 package org.apache.syncope.mod;
 
+import javax.xml.bind.annotation.XmlRootElement;
+
 import org.apache.syncope.AbstractBaseBean;
 
 /**
@@ -25,6 +27,7 @@ import org.apache.syncope.AbstractBaseBe
  * current reference id; use a ReferenceMod with a null id to try to reset the reference id; use a ReferenceMod with a
  * not null id to specify a new reference id.
  */
+@XmlRootElement
 public class ReferenceMod extends AbstractBaseBean {
 
     private static final long serialVersionUID = -4188817853738067677L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/RoleMod.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/RoleMod.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/RoleMod.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/RoleMod.java Tue Dec  4 08:55:06 2012
@@ -18,9 +18,14 @@
  */
 package org.apache.syncope.mod;
 
-import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
 import org.codehaus.jackson.annotate.JsonIgnore;
 
+@XmlRootElement
 public class RoleMod extends AbstractAttributableMod {
 
     private static final long serialVersionUID = 7455805264680210747L;
@@ -43,7 +48,9 @@ public class RoleMod extends AbstractAtt
 
     private Boolean inheritPasswordPolicy;
 
-    private List<String> entitlements;
+    protected Set<String> entitlementsToBeAdded = new HashSet<String>();
+
+    protected Set<String> entitlementsToBeRemoved = new HashSet<String>();
 
     private ReferenceMod passwordPolicy;
 
@@ -105,12 +112,28 @@ public class RoleMod extends AbstractAtt
         this.inheritVirtualAttributes = inheritVirtualAttributes;
     }
 
-    public List<String> getEntitlements() {
-        return entitlements;
+    public Set<String> getEntitlementsToBeRemoved() {
+        return entitlementsToBeRemoved;
+    }
+
+    public Set<String> getEntitlementsToBeAdded() {
+        return entitlementsToBeAdded;
+    }
+
+    public void addEntitlementsToBeRemoved(final String entitlements) {
+        this.entitlementsToBeRemoved.add(entitlements);
+    }
+
+    public void addEntitlementsToBeAdded(final String entitlements) {
+        this.entitlementsToBeAdded.add(entitlements);
+    }
+
+    public void setEntitlementsToBeRemoved(final Set<String> entitlements) {
+        this.entitlementsToBeRemoved = entitlements;
     }
 
-    public void setEntitlements(final List<String> entitlements) {
-        this.entitlements = entitlements;
+    public void setEntitlementsToBeAdded(final Set<String> entitlements) {
+        this.entitlementsToBeAdded = entitlements;
     }
 
     public ReferenceMod getPasswordPolicy() {
@@ -150,7 +173,8 @@ public class RoleMod extends AbstractAtt
     public boolean isEmpty() {
         return super.isEmpty() && name == null && userOwner == null && roleOwner == null
                 && inheritOwner == null && inheritAccountPolicy == null && inheritPasswordPolicy == null
-                && inheritAttributes == null && inheritDerivedAttributes == null && inheritVirtualAttributes == null
-                && accountPolicy == null && passwordPolicy == null && (entitlements == null || entitlements.isEmpty());
+                && inheritAttributes == null && inheritDerivedAttributes == null
+                && inheritVirtualAttributes == null && accountPolicy == null && passwordPolicy == null
+                && (entitlementsToBeAdded.isEmpty()) && (entitlementsToBeRemoved.isEmpty());
     }
 }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/UserMod.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/UserMod.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/UserMod.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/mod/UserMod.java Tue Dec  4 08:55:06 2012
@@ -20,8 +20,16 @@ package org.apache.syncope.mod;
 
 import java.util.HashSet;
 import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.codehaus.jackson.annotate.JsonIgnore;
 
+@XmlRootElement
+@XmlType
 public class UserMod extends AbstractAttributableMod {
 
     private static final long serialVersionUID = 3081848906558106204L;
@@ -49,6 +57,8 @@ public class UserMod extends AbstractAtt
         return membershipsToBeAdded.remove(membershipMod);
     }
 
+    @XmlElement(name = "membershipMod")
+    @XmlElementWrapper(name = "membershipsToBeAdded")
     public Set<MembershipMod> getMembershipsToBeAdded() {
         return membershipsToBeAdded;
     }
@@ -81,6 +91,8 @@ public class UserMod extends AbstractAtt
         return membershipsToBeRemoved.remove(membershipToBeRemoved);
     }
 
+    @XmlElement(name = "id")
+    @XmlElementWrapper(name = "membershipsToBeRemoved")
     public Set<Long> getMembershipsToBeRemoved() {
         return membershipsToBeRemoved;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/AttributeCond.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/AttributeCond.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/AttributeCond.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/AttributeCond.java Tue Dec  4 08:55:06 2012
@@ -18,15 +18,19 @@
  */
 package org.apache.syncope.search;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
 /**
  * Search condition to be applied when comparing attribute values.
  */
+@XmlType(name = "AttributeCond")
 public class AttributeCond extends AbstractBaseBean {
 
     private static final long serialVersionUID = 3275277728404021417L;
 
+    @XmlType(name = "AttributeCondType")
     public enum Type {
 
         LIKE,

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/MembershipCond.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/MembershipCond.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/MembershipCond.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/MembershipCond.java Tue Dec  4 08:55:06 2012
@@ -18,11 +18,14 @@
  */
 package org.apache.syncope.search;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
 /**
  * Search condition to be applied when searching for memberships.
  */
+@XmlType
 public class MembershipCond extends AbstractBaseBean {
 
     private static final long serialVersionUID = -728155256293925989L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/NodeCond.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/NodeCond.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/NodeCond.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/NodeCond.java Tue Dec  4 08:55:06 2012
@@ -18,12 +18,18 @@
  */
 package org.apache.syncope.search;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
+@XmlRootElement
+@XmlType(name = "NodeCond")
 public class NodeCond extends AbstractBaseBean {
 
     private static final long serialVersionUID = -8508611056176961293L;
 
+    @XmlType(name = "NodeCondType")
     public enum Type {
 
         LEAF,

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/ResourceCond.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/ResourceCond.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/ResourceCond.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/ResourceCond.java Tue Dec  4 08:55:06 2012
@@ -18,11 +18,14 @@
  */
 package org.apache.syncope.search;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
 /**
  * Search condition to be applied when searching for associated resources.
  */
+@XmlType
 public class ResourceCond extends AbstractBaseBean {
 
     private static final long serialVersionUID = -4577460657640881223L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/SyncopeUserCond.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/SyncopeUserCond.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/SyncopeUserCond.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/search/SyncopeUserCond.java Tue Dec  4 08:55:06 2012
@@ -18,9 +18,12 @@
  */
 package org.apache.syncope.search;
 
+import javax.xml.bind.annotation.XmlType;
+
 /**
  * Search condition to be applied when comparing bean attribute values.
  */
+@XmlType
 public class SyncopeUserCond extends AttributeCond {
 
     private static final long serialVersionUID = -1880319220462653955L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AbstractAttributableTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AbstractAttributableTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AbstractAttributableTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AbstractAttributableTO.java Tue Dec  4 08:55:06 2012
@@ -25,8 +25,14 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
 import org.codehaus.jackson.annotate.JsonIgnore;
 
+@XmlType
 public abstract class AbstractAttributableTO extends ConnObjectTO {
 
     private static final long serialVersionUID = 4083884098736820255L;
@@ -97,6 +103,8 @@ public abstract class AbstractAttributab
         return derivedAttributes.remove(derivedAttribute);
     }
 
+    @XmlElement(name="attributeTO")
+    @XmlElementWrapper(name="derivedAttributes")
     public List<AttributeTO> getDerivedAttributes() {
         return derivedAttributes;
     }
@@ -114,6 +122,8 @@ public abstract class AbstractAttributab
         return virtualAttributes.remove(virtualAttribute);
     }
 
+    @XmlElement(name="attributeTO")
+    @XmlElementWrapper(name="virtualAttributes")
     public List<AttributeTO> getVirtualAttributes() {
         return virtualAttributes;
     }
@@ -130,6 +140,8 @@ public abstract class AbstractAttributab
         return resources.remove(resource);
     }
 
+    @XmlElement(name="resource")
+    @XmlElementWrapper(name="resources")
     public Set<String> getResources() {
         return resources;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AttributeTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AttributeTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AttributeTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/AttributeTO.java Tue Dec  4 08:55:06 2012
@@ -21,8 +21,12 @@ package org.apache.syncope.to;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
+@XmlType
 public class AttributeTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 4941691338796323623L;
@@ -59,7 +63,8 @@ public class AttributeTO extends Abstrac
     }
 
     /**
-     * @param schema name to be set
+     * @param schema
+     *            name to be set
      */
     public void setSchema(final String schema) {
         this.schema = schema;
@@ -67,7 +72,8 @@ public class AttributeTO extends Abstrac
     }
 
     /**
-     * @param value an attribute value to be added
+     * @param value
+     *            an attribute value to be added
      * @return whether the operation succeeded or not
      */
     public boolean addValue(final String value) {
@@ -77,7 +83,8 @@ public class AttributeTO extends Abstrac
     }
 
     /**
-     * @param value an attribute value to be removed
+     * @param value
+     *            an attribute value to be removed
      * @return whether the operation succeeded or not
      */
     public boolean removeValue(final String value) {
@@ -89,12 +96,14 @@ public class AttributeTO extends Abstrac
     /**
      * @return attribute values as strings
      */
+    @XmlElement(name = "value")
     public List<String> getValues() {
         return values;
     }
 
     /**
-     * @param values set of (string) values
+     * @param values
+     *            set of (string) values
      */
     public void setValues(final List<String> values) {
         if (!isReadonly()) {

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConfigurationTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConfigurationTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConfigurationTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConfigurationTO.java Tue Dec  4 08:55:06 2012
@@ -18,8 +18,13 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
+@XmlType
+@XmlRootElement
 public class ConfigurationTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -3825039700228595590L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnBundleTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnBundleTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnBundleTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnBundleTO.java Tue Dec  4 08:55:06 2012
@@ -21,9 +21,14 @@ package org.apache.syncope.to;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.types.ConnConfPropSchema;
 
+@XmlType
 public class ConnBundleTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 7215115961910138005L;
@@ -66,6 +71,8 @@ public class ConnBundleTO extends Abstra
         this.displayName = displayName;
     }
 
+    @XmlElement(name = "connConfPropSchema")
+    @XmlElementWrapper(name = "properties")
     public List<ConnConfPropSchema> getProperties() {
         return properties;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnInstanceTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnInstanceTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnInstanceTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnInstanceTO.java Tue Dec  4 08:55:06 2012
@@ -25,11 +25,16 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.types.ConnConfProperty;
 import org.apache.syncope.types.ConnectorCapability;
 import org.codehaus.jackson.annotate.JsonIgnore;
 
+@XmlType
 public class ConnInstanceTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 2707778645445168671L;
@@ -79,6 +84,8 @@ public class ConnInstanceTO extends Abst
         this.version = bundleversion;
     }
 
+    @XmlElement(name = "connConfProperty")
+    @XmlElementWrapper(name = "configuration")
     public Set<ConnConfProperty> getConfiguration() {
         return this.configuration;
     }
@@ -131,6 +138,8 @@ public class ConnInstanceTO extends Abst
         return capabilities.remove(capability);
     }
 
+    @XmlElement(name = "connectorCapability")
+    @XmlElementWrapper(name = "capabilities")
     public Set<ConnectorCapability> getCapabilities() {
         return capabilities;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnObjectTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnObjectTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnObjectTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ConnObjectTO.java Tue Dec  4 08:55:06 2012
@@ -24,9 +24,16 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.codehaus.jackson.annotate.JsonIgnore;
 
+@XmlType
+@XmlRootElement
 public class ConnObjectTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 5139554911265442497L;
@@ -47,6 +54,8 @@ public class ConnObjectTO extends Abstra
         return attributes.remove(attribute);
     }
 
+    @XmlElement(name="attributeTO")
+    @XmlElementWrapper(name="attributes")
     public List<AttributeTO> getAttributes() {
         return attributes;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/DerivedSchemaTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/DerivedSchemaTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/DerivedSchemaTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/DerivedSchemaTO.java Tue Dec  4 08:55:06 2012
@@ -18,8 +18,11 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
+@XmlType
 public class DerivedSchemaTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -5758594647387239936L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/LoggerTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/LoggerTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/LoggerTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/LoggerTO.java Tue Dec  4 08:55:06 2012
@@ -18,9 +18,14 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.types.SyncopeLoggerLevel;
 
+@XmlRootElement
+@XmlType
 public class LoggerTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -7794833835668648505L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/MembershipTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/MembershipTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/MembershipTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/MembershipTO.java Tue Dec  4 08:55:06 2012
@@ -21,6 +21,11 @@ package org.apache.syncope.to;
 import java.util.Collections;
 import java.util.Set;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType
+@XmlRootElement
 public class MembershipTO extends AbstractAttributableTO {
 
     private static final long serialVersionUID = 5992828670273935861L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTO.java Tue Dec  4 08:55:06 2012
@@ -21,11 +21,16 @@ package org.apache.syncope.to;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.search.NodeCond;
 import org.apache.syncope.types.IntMappingType;
 import org.apache.syncope.types.TraceLevel;
 
+@XmlType
 public class NotificationTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -6145117115632592612L;
@@ -64,6 +69,8 @@ public class NotificationTO extends Abst
         this.about = about;
     }
 
+    @XmlElement(name = " event")
+    @XmlElementWrapper(name = "events")
     public List<String> getEvents() {
         return events;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTaskTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTaskTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTaskTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/NotificationTaskTO.java Tue Dec  4 08:55:06 2012
@@ -20,13 +20,19 @@ package org.apache.syncope.to;
 
 import java.util.HashSet;
 import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.types.TraceLevel;
 
+@XmlType
 public class NotificationTaskTO extends TaskTO {
 
     private static final long serialVersionUID = 371671242591093846L;
 
-    private Set<String> recipients;
+    private final Set<String> recipients;
 
     private String sender;
 
@@ -46,6 +52,8 @@ public class NotificationTaskTO extends 
         recipients = new HashSet<String>();
     }
 
+    @XmlElement(name = "recipient")
+    @XmlElementWrapper(name = "recipients")
     public Set<String> getRecipients() {
         return recipients;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PasswordPolicyTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PasswordPolicyTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PasswordPolicyTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PasswordPolicyTO.java Tue Dec  4 08:55:06 2012
@@ -18,9 +18,12 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.types.PasswordPolicySpec;
 import org.apache.syncope.types.PolicyType;
 
+@XmlType
 public class PasswordPolicyTO extends PolicyTO {
 
     private static final long serialVersionUID = -5606086441294799690L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PolicyTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PolicyTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PolicyTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PolicyTO.java Tue Dec  4 08:55:06 2012
@@ -18,9 +18,12 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.types.PolicyType;
 
+@XmlType
 public abstract class PolicyTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -2903888572649721035L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTO.java Tue Dec  4 08:55:06 2012
@@ -18,12 +18,17 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.types.PropagationTaskExecStatus;
 
 /**
  * Single propagation status.
  */
+@XmlType
+@XmlRootElement
 public class PropagationTO extends AbstractBaseBean {
 
     /**

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTaskTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTaskTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTaskTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/PropagationTaskTO.java Tue Dec  4 08:55:06 2012
@@ -18,9 +18,12 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.types.PropagationMode;
 import org.apache.syncope.types.PropagationOperation;
 
+@XmlType
 public class PropagationTaskTO extends TaskTO {
 
     private static final long serialVersionUID = 386450127003321197L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportExecTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportExecTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportExecTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportExecTO.java Tue Dec  4 08:55:06 2012
@@ -18,8 +18,11 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.types.ReportExecStatus;
 
+@XmlType
 public class ReportExecTO extends AbstractExecTO {
 
     private static final long serialVersionUID = -1025555939724089215L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ReportTO.java Tue Dec  4 08:55:06 2012
@@ -22,9 +22,14 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.report.ReportletConf;
 
+@XmlRootElement
+@XmlType
 public class ReportTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 5274568072084814410L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ResourceTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ResourceTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ResourceTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/ResourceTO.java Tue Dec  4 08:55:06 2012
@@ -23,11 +23,16 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.types.ConnConfProperty;
 import org.apache.syncope.types.PropagationMode;
 import org.apache.syncope.types.TraceLevel;
 
+@XmlRootElement
+@XmlType
 public class ResourceTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -9193551354041698963L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/RoleTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/RoleTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/RoleTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/RoleTO.java Tue Dec  4 08:55:06 2012
@@ -20,9 +20,18 @@ package org.apache.syncope.to;
 
 import java.util.ArrayList;
 import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 
-@JsonIgnoreProperties({"displayName", "empty"})
+@XmlRootElement
+@XmlType
+@JsonIgnoreProperties({ "displayName", "empty" })
 public class RoleTO extends AbstractAttributableTO {
 
     private static final long serialVersionUID = -7785920258290147542L;
@@ -47,26 +56,31 @@ public class RoleTO extends AbstractAttr
 
     private boolean inheritAccountPolicy;
 
-    private List<String> entitlements;
+    private final List<String> entitlements = new ArrayList<String>();;
 
     private Long passwordPolicy;
 
     private Long accountPolicy;
 
-    public RoleTO() {
-        entitlements = new ArrayList<String>();
+    public long getParent() {
+        return parent;
     }
 
     public String getName() {
         return name;
     }
 
-    public void setName(final String name) {
-        this.name = name;
+    @XmlElement(name = "value")
+    @XmlElementWrapper(name = "entitlements")
+    //WARNING do not rename this method to getEntitlements, it causes strange problems when unmarshalling
+    public List<String> getEntitlementList() {
+        List<String> list = new ArrayList<String>();
+        list.add("Test");
+        return entitlements;
     }
 
-    public long getParent() {
-        return parent;
+    public void setName(final String name) {
+        this.name = name;
     }
 
     public void setParent(final long parent) {
@@ -130,10 +144,6 @@ public class RoleTO extends AbstractAttr
         return entitlements.remove(entitlement);
     }
 
-    public List<String> getEntitlements() {
-        return entitlements;
-    }
-
     public void setEntitlements(List<String> entitlements) {
         this.entitlements.clear();
         if (entitlements != null && !entitlements.isEmpty()) {
@@ -154,9 +164,11 @@ public class RoleTO extends AbstractAttr
     }
 
     /**
-     * Specify if password policy must be inherited. In this case eventual passwordPolicy occurrence will be ignored.
+     * Specify if password policy must be inherited. In this case eventual
+     * passwordPolicy occurrence will be ignored.
      *
-     * @param inheritPasswordPolicy 'true' to inherit policy, false otherwise.
+     * @param inheritPasswordPolicy
+     *            'true' to inherit policy, false otherwise.
      */
     public void setInheritPasswordPolicy(boolean inheritPasswordPolicy) {
         this.inheritPasswordPolicy = inheritPasswordPolicy;
@@ -175,14 +187,17 @@ public class RoleTO extends AbstractAttr
     }
 
     /**
-     * Specify if account policy must be inherited. In this case eventual accountPolicy occurrence will be ignored.
+     * Specify if account policy must be inherited. In this case eventual
+     * accountPolicy occurrence will be ignored.
      *
-     * @param inheritAccountPolicy 'true' to inherit policy, false otherwise.
+     * @param inheritAccountPolicy
+     *            'true' to inherit policy, false otherwise.
      */
     public void setInheritAccountPolicy(boolean inheritAccountPolicy) {
         this.inheritAccountPolicy = inheritAccountPolicy;
     }
 
+    @XmlTransient
     public String getDisplayName() {
         return getId() + " " + getName();
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchedTaskTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchedTaskTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchedTaskTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchedTaskTO.java Tue Dec  4 08:55:06 2012
@@ -20,6 +20,9 @@ package org.apache.syncope.to;
 
 import java.util.Date;
 
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType
 public class SchedTaskTO extends TaskTO {
 
     private static final long serialVersionUID = -5722284116974636425L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaMappingTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaMappingTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaMappingTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaMappingTO.java Tue Dec  4 08:55:06 2012
@@ -18,9 +18,12 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.types.IntMappingType;
 
+@XmlType
 public class SchemaMappingTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -5948464320236155366L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SchemaTO.java Tue Dec  4 08:55:06 2012
@@ -18,10 +18,13 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.types.SchemaType;
 
+@XmlType
 public class SchemaTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -8133983392476990308L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncPolicyTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncPolicyTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncPolicyTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncPolicyTO.java Tue Dec  4 08:55:06 2012
@@ -18,9 +18,12 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.types.PolicyType;
 import org.apache.syncope.types.SyncPolicySpec;
 
+@XmlType
 public class SyncPolicyTO extends PolicyTO {
 
     private static final long serialVersionUID = 993024634238024242L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncTaskTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncTaskTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncTaskTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/SyncTaskTO.java Tue Dec  4 08:55:06 2012
@@ -18,6 +18,9 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType
 public class SyncTaskTO extends SchedTaskTO {
 
     private static final long serialVersionUID = -2143537546915809016L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskExecTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskExecTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskExecTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskExecTO.java Tue Dec  4 08:55:06 2012
@@ -18,6 +18,9 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType
 public class TaskExecTO extends AbstractExecTO {
 
     private static final long serialVersionUID = -5401795154606268973L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/TaskTO.java Tue Dec  4 08:55:06 2012
@@ -22,8 +22,13 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
+@XmlType
+@XmlRootElement
 public class TaskTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 386450127003321197L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserRequestTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserRequestTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserRequestTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserRequestTO.java Tue Dec  4 08:55:06 2012
@@ -18,10 +18,15 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.mod.UserMod;
 import org.apache.syncope.types.UserRequestType;
 
+@XmlRootElement
+@XmlType
 public class UserRequestTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 1228351243795629329L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/UserTO.java Tue Dec  4 08:55:06 2012
@@ -25,10 +25,18 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.commons.lang.builder.ReflectionToStringBuilder;
 import org.apache.commons.lang.builder.ToStringStyle;
 import org.codehaus.jackson.annotate.JsonIgnore;
 
+@XmlRootElement
+@XmlType
 public class UserTO extends AbstractAttributableTO {
 
     private static final long serialVersionUID = 7791304495192615740L;
@@ -37,7 +45,7 @@ public class UserTO extends AbstractAttr
 
     private List<MembershipTO> memberships;
 
-    private List<PropagationTO> propagationTOs;
+    private final List<PropagationTO> propagationTOs;
 
     private String status;
 
@@ -78,6 +86,8 @@ public class UserTO extends AbstractAttr
         return memberships.remove(membershipTO);
     }
 
+    @XmlElement(name="membershipTO")
+    @XmlElementWrapper(name="memberships")
     public List<MembershipTO> getMemberships() {
         return memberships;
     }
@@ -190,6 +200,8 @@ public class UserTO extends AbstractAttr
         }
     }
 
+    @XmlElement(name="propagationTO")
+    @XmlElementWrapper(name="propagations")
     public List<PropagationTO> getPropagationTOs() {
         return propagationTOs;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/VirtualSchemaTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/VirtualSchemaTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/VirtualSchemaTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/VirtualSchemaTO.java Tue Dec  4 08:55:06 2012
@@ -18,8 +18,11 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
+@XmlType
 public class VirtualSchemaTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -632352302417688896L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowDefinitionTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowDefinitionTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowDefinitionTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowDefinitionTO.java Tue Dec  4 08:55:06 2012
@@ -18,8 +18,13 @@
  */
 package org.apache.syncope.to;
 
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 
+@XmlRootElement
+@XmlType
 public class WorkflowDefinitionTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 8803733012885686826L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormPropertyTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormPropertyTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormPropertyTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormPropertyTO.java Tue Dec  4 08:55:06 2012
@@ -21,9 +21,12 @@ package org.apache.syncope.to;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.apache.syncope.types.WorkflowFormPropertyType;
 
+@XmlType
 public class WorkflowFormPropertyTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 9139969592634304261L;

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormTO.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormTO.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormTO.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/to/WorkflowFormTO.java Tue Dec  4 08:55:06 2012
@@ -26,9 +26,16 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.syncope.AbstractBaseBean;
 import org.codehaus.jackson.annotate.JsonIgnore;
 
+@XmlRootElement
+@XmlType
 public class WorkflowFormTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = -7044543391316529128L;
@@ -99,6 +106,8 @@ public class WorkflowFormTO extends Abst
         this.owner = owner;
     }
 
+    @XmlElement(name="workflowFormPropertyTO")
+    @XmlElementWrapper(name="properties")
     public List<WorkflowFormPropertyTO> getProperties() {
         return properties;
     }

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/PropagationTaskExecStatus.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/PropagationTaskExecStatus.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/PropagationTaskExecStatus.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/PropagationTaskExecStatus.java Tue Dec  4 08:55:06 2012
@@ -18,6 +18,8 @@
  */
 package org.apache.syncope.types;
 
+import javax.xml.bind.annotation.XmlType;
+
 /**
  * Status of a TaskExecution.
  *
@@ -27,6 +29,7 @@ package org.apache.syncope.types;
  * report success or failure).
  *
  */
+@XmlType(name = "PropagationTaskExecStatus")
 public enum PropagationTaskExecStatus {
 
     CREATED,

Modified: syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/WorkflowFormPropertyType.java
URL: http://svn.apache.org/viewvc/syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/WorkflowFormPropertyType.java?rev=1416823&r1=1416822&r2=1416823&view=diff
==============================================================================
--- syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/WorkflowFormPropertyType.java (original)
+++ syncope/branches/cxf/common/src/main/java/org/apache/syncope/types/WorkflowFormPropertyType.java Tue Dec  4 08:55:06 2012
@@ -18,6 +18,9 @@
  */
 package org.apache.syncope.types;
 
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "WorkflowFormPropertyType")
 public enum WorkflowFormPropertyType {
 
     String,



Mime
View raw message