syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1534986 [1/6] - in /syncope/trunk: ./ common/ common/src/main/java/org/apache/syncope/common/ common/src/main/java/org/apache/syncope/common/mod/ common/src/main/java/org/apache/syncope/common/report/ common/src/main/java/org/apache/syncop...
Date Wed, 23 Oct 2013 11:16:24 GMT
Author: ilgrosso
Date: Wed Oct 23 11:16:23 2013
New Revision: 1534986

URL: http://svn.apache.org/r1534986
Log:
[SYNCOPE-151] Introducing support for live RESTful API documentation based on XSLT transformation of WADL dynamically generated by CXF

Added:
    syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/package-info.java   (with props)
    syncope/trunk/common/src/main/java/org/apache/syncope/common/package-info.java   (with props)
    syncope/trunk/common/src/main/java/org/apache/syncope/common/report/package-info.java   (with props)
    syncope/trunk/common/src/main/java/org/apache/syncope/common/search/package-info.java   (with props)
    syncope/trunk/common/src/main/java/org/apache/syncope/common/to/package-info.java   (with props)
    syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ReportletConfClasses.java
      - copied, changed from r1533338, syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportletConfClasses.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowTasks.java
      - copied, changed from r1533338, syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowTasks.java
    syncope/trunk/common/src/test/java/org/
      - copied from r1534526, syncope/trunk/common/src/test/java/org/
    syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/WADLServlet.java   (with props)
    syncope/trunk/core/src/main/resources/wadl2html/   (with props)
    syncope/trunk/core/src/main/resources/wadl2html/index.xsl   (with props)
    syncope/trunk/core/src/main/resources/wadl2html/schema.xsl   (with props)
    syncope/trunk/core/src/main/webapp/css/
    syncope/trunk/core/src/main/webapp/css/highlight.css   (with props)
    syncope/trunk/core/src/main/webapp/css/images/
    syncope/trunk/core/src/main/webapp/css/images/ui-bg_flat_0_aaaaaa_40x100.png   (with props)
    syncope/trunk/core/src/main/webapp/css/images/ui-bg_flat_75_ffffff_40x100.png   (with props)
    syncope/trunk/core/src/main/webapp/css/images/ui-bg_glass_65_ffffff_1x400.png   (with props)
    syncope/trunk/core/src/main/webapp/css/images/ui-bg_glass_75_dadada_1x400.png   (with props)
    syncope/trunk/core/src/main/webapp/css/images/ui-bg_glass_75_e6e6e6_1x400.png   (with props)
    syncope/trunk/core/src/main/webapp/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png   (with props)
    syncope/trunk/core/src/main/webapp/css/images/ui-icons_454545_256x240.png   (with props)
    syncope/trunk/core/src/main/webapp/css/images/ui-icons_888888_256x240.png   (with props)
    syncope/trunk/core/src/main/webapp/css/jquery-ui.css   (with props)
    syncope/trunk/core/src/main/webapp/css/style.css   (with props)
    syncope/trunk/core/src/main/webapp/js/   (with props)
    syncope/trunk/core/src/main/webapp/js/highlight.pack.js   (with props)
    syncope/trunk/core/src/main/webapp/js/jquery-ui.js   (with props)
    syncope/trunk/core/src/main/webapp/js/jquery.js   (with props)
Removed:
    syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportletConfClasses.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowTasks.java
Modified:
    syncope/trunk/   (props changed)
    syncope/trunk/common/pom.xml
    syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationTargetsTO.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AuditLoggerName.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/types/package-info.java
    syncope/trunk/common/src/test/java/org/apache/syncope/common/JSONTest.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java
    syncope/trunk/core/src/main/resources/restContext.xml
    syncope/trunk/core/src/main/webapp/WEB-INF/web.xml
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ResourceTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java
    syncope/trunk/legal_ext/LICENSE
    syncope/trunk/legal_ext/NOTICE
    syncope/trunk/pom.xml

Propchange: syncope/trunk/
------------------------------------------------------------------------------
  Merged /syncope/branches/1_1_X:r1533513-1534526

Modified: syncope/trunk/common/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/common/pom.xml?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/common/pom.xml (original)
+++ syncope/trunk/common/pom.xml Wed Oct 23 11:16:23 2013
@@ -46,7 +46,11 @@ under the License.
       <groupId>javax.ws.rs</groupId>
       <artifactId>javax.ws.rs-api</artifactId>
     </dependency>
-
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+    </dependency>
+      
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java Wed Oct 23 11:16:23 2013
@@ -20,6 +20,8 @@ package org.apache.syncope.common;
 
 public class SyncopeConstants {
 
+    public static final String NAMESPACE = "http://syncope.apache.org/1.2";
+
     public static final String UNAUTHENTICATED = "unauthenticated";
 
     public static final String ANONYMOUS_ENTITLEMENT = "anonymous";

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/package-info.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/package-info.java?rev=1534986&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/package-info.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/package-info.java Wed Oct 23 11:16:23 2013
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+@XmlSchema(namespace = SyncopeConstants.NAMESPACE)
+package org.apache.syncope.common.mod;
+
+import javax.xml.bind.annotation.XmlSchema;
+import org.apache.syncope.common.SyncopeConstants;

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/package-info.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/package-info.java?rev=1534986&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/package-info.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/package-info.java Wed Oct 23 11:16:23 2013
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+@XmlSchema(namespace = SyncopeConstants.NAMESPACE)
+package org.apache.syncope.common;
+
+import javax.xml.bind.annotation.XmlSchema;

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/package-info.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/report/package-info.java?rev=1534986&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/report/package-info.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/report/package-info.java Wed Oct 23 11:16:23 2013
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+@XmlSchema(namespace = SyncopeConstants.NAMESPACE)
+package org.apache.syncope.common.report;
+
+import javax.xml.bind.annotation.XmlSchema;
+import org.apache.syncope.common.SyncopeConstants;

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/package-info.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/search/package-info.java?rev=1534986&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/search/package-info.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/search/package-info.java Wed Oct 23 11:16:23 2013
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+@XmlSchema(namespace = SyncopeConstants.NAMESPACE)
+package org.apache.syncope.common.search;
+
+import javax.xml.bind.annotation.XmlSchema;
+import org.apache.syncope.common.SyncopeConstants;

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java Wed Oct 23 11:16:23 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.common.services;
 
+import org.apache.syncope.common.types.ReportletConfClasses;
 import java.util.List;
 import javax.ws.rs.DELETE;
 import javax.ws.rs.DefaultValue;

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java Wed Oct 23 11:16:23 2013
@@ -19,6 +19,7 @@
 package org.apache.syncope.common.services;
 
 import java.util.List;
+import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
 import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
@@ -26,8 +27,13 @@ import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.model.wadl.Description;
+import org.apache.cxf.jaxrs.model.wadl.Descriptions;
+import org.apache.cxf.jaxrs.model.wadl.DocTarget;
 import org.apache.syncope.common.mod.UserMod;
 import org.apache.syncope.common.search.NodeCond;
 import org.apache.syncope.common.to.BulkAction;
@@ -37,137 +43,472 @@ import org.apache.syncope.common.to.Prop
 import org.apache.syncope.common.to.UserTO;
 
 @Path("users")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
 public interface UserService {
 
-    @PUT
-    @Path("{userId}/status/activate")
-    UserTO activate(@PathParam("userId") long userId, @QueryParam("token") String token);
-
-    @PUT
-    @Path("{userId}/status/activate/propagation")
-    UserTO activate(@PathParam("userId") long userId, @QueryParam("token") String token,
-            PropagationRequestTO propagationRequestTO);
-
-    @PUT
-    @Path("activateByUsername/{username}")
-    UserTO activateByUsername(@PathParam("username") String username, @QueryParam("token") String token);
-
-    @PUT
-    @Path("activateByUsername/{username}/propagation")
-    UserTO activateByUsername(@PathParam("username") String username, @QueryParam("token") String token,
-            PropagationRequestTO propagationRequestTO);
-
+    /**
+     * Reads the user matching the provided userId.
+     *
+     * @param userId id of user to be read
+     * @return User matching the provided userId
+     */
     @GET
-    @Path("count")
-    int count();
-
-    @POST
-    Response create(UserTO userTO);
-
-    @DELETE
     @Path("{userId}")
-    UserTO delete(@PathParam("userId") Long userId);
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Reads the user matching the provided userId"),
+        @Description(target = DocTarget.RETURN, value = "User matching the provided userId")
+    })
+    UserTO read(@Description("id of user to be read") @PathParam("userId") Long userId);
 
+    /**
+     * Returns a list of all existing users.
+     *
+     * @return A list of all existing users.
+     */
     @GET
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Returns a list of all existing users"),
+        @Description(target = DocTarget.RETURN, value = "A list of all existing users")
+    })
     List<UserTO> list();
 
+    /**
+     * Returns a paged list of all existing users.
+     *
+     * @param page result page number
+     * @param size number of entries per page
+     * @return A list of all existing users matching page/size conditions.
+     */
     @GET
-    List<UserTO> list(@QueryParam("page") int page, @QueryParam("size") @DefaultValue("25") int size);
-
-    @PUT
-    @Path("{userId}/status/reactivate")
-    UserTO reactivate(@PathParam("userId") long userId);
-
-    @PUT
-    @Path("{userId}/status/reactivate/propagation")
-    UserTO reactivate(@PathParam("userId") long userId, PropagationRequestTO propagationRequestTO);
-
-    @PUT
-    @Path("reactivateByUsername/{username}")
-    UserTO reactivateByUsername(@PathParam("username") String username);
-
-    @PUT
-    @Path("reactivateByUsername/{username}/propagation")
-    UserTO reactivateByUsername(@PathParam("username") String username, PropagationRequestTO propagationRequestTO);
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Returns a paged list of all existing users"),
+        @Description(target = DocTarget.RETURN, value = "A list of all existing users matching page/size conditions")
+    })
+    List<UserTO> list(@Description("result page number") @QueryParam("page") int page,
+            @Description("number of entries per page") @QueryParam("size") @DefaultValue("25") int size);
 
+    /**
+     * Returns the number of existing users.
+     *
+     * @return Number of existing users
+     */
     @GET
-    @Path("{userId}")
-    UserTO read(@PathParam("userId") Long userId);
+    @Path("count")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Returns the number of existing users"),
+        @Description(target = DocTarget.RETURN, value = "Number of existing users")
+    })
+    int count();
 
+    /**
+     * Reads the user matching the provided username.
+     *
+     * @param username username of user to be read
+     * @return User matching the provided username
+     */
     @GET
-    UserTO read(@QueryParam("username") String username);
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Reads the user matching the provided username"),
+        @Description(target = DocTarget.RETURN, value = "User matching the provided username")
+    })
+    UserTO read(@Description("username of user to be read") @QueryParam("username") String username);
 
+    /**
+     * Reads data about the authenticated user.
+     *
+     * @return Data about the authenticated user
+     */
     @GET
     @Path("self")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Reads the user matching the provided username"),
+        @Description(target = DocTarget.RETURN, value = "Data about the authenticated user")
+    })
     UserTO readSelf();
 
+    /**
+     * Returns the list of users matching the given search condition.
+     *
+     * @param searchCondition search condition
+     * @return List of users matching the given search condition
+     * @throws InvalidSearchConditionException if provided search condition is not valid
+     */
     @POST
     @Path("search")
-    List<UserTO> search(NodeCond searchCondition) throws InvalidSearchConditionException;
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Returns the list of users matching the given search condition"),
+        @Description(target = DocTarget.RETURN, value = "List of users matching the given condition")
+    })
+    List<UserTO> search(@Description("search condition") NodeCond searchCondition)
+            throws InvalidSearchConditionException;
 
+    /**
+     * Returns the paged list of users matching the given search condition.
+     *
+     * @param searchCondition search condition
+     * @param page result page number
+     * @param size number of entries per page
+     * @return List of users matching the given search and page/size conditions
+     * @throws InvalidSearchConditionException if provided search condition is not valid
+     */
     @POST
     @Path("search")
-    List<UserTO> search(NodeCond searchCondition, @QueryParam("page") int page,
-            @QueryParam("size") @DefaultValue("25") int size) throws InvalidSearchConditionException;
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Returns the paged list of users matching the given search condition"),
+        @Description(target = DocTarget.RETURN,
+                value = "List of users matching the given search and page/size conditions")
+    })
+    List<UserTO> search(@Description("search condition") NodeCond searchCondition,
+            @Description("result page number") @QueryParam("page") int page,
+            @Description("number of entries per page") @QueryParam("size") @DefaultValue("25") int size)
+            throws InvalidSearchConditionException;
 
+    /**
+     * Returns the number of users matching the provided search condition.
+     *
+     * @param searchCondition search condition
+     * @return Number of users matching the provided search condition
+     * @throws InvalidSearchConditionException if provided search condition is not valid
+     */
     @POST
     @Path("search/count")
-    int searchCount(NodeCond searchCondition) throws InvalidSearchConditionException;
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Returns the number of users matching the provided search condition"),
+        @Description(target = DocTarget.RETURN,
+                value = "Number of users matching the provided search condition")
+    })
+    int searchCount(@Description("search condition") NodeCond searchCondition)
+            throws InvalidSearchConditionException;
+
+    /**
+     * Creates a new user.
+     *
+     * @param userTO user to be created
+     * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created user
+     */
+    @POST
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Creates a new user"),
+        @Description(target = DocTarget.RETURN,
+                value = "Response object featuring <tt>Location</tt> header of created user"),
+        @Description(target = DocTarget.RESPONSE,
+                value = "User created available at URL specified via the <tt>Location</tt> header")
+    })
+    Response create(@Description("user to be created") UserTO userTO);
 
+    /**
+     * Updates user matching the provided userId.
+     *
+     * @param userId id of user to be updated
+     * @param userMod modification to be applied to user matching the provided userId
+     * @return Updated user.
+     */
     @PUT
+    @Path("{userId}")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Updates user matching the provided userId"),
+        @Description(target = DocTarget.RETURN, value = "Updated user")
+    })
+    UserTO update(@Description("id of user to be updated") @PathParam("userId") Long userId,
+            @Description("modification to be applied to user matching the provided userId") UserMod userMod);
+
+    /**
+     * Deletes user matching provided userId.
+     *
+     * @param userId id of user to be deleted
+     * @return Deleted user
+     */
+    @DELETE
+    @Path("{userId}")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Deletes user matching provided userId"),
+        @Description(target = DocTarget.RETURN, value = "Deleted user")
+    })
+    UserTO delete(@Description("id of user to be deleted") @PathParam("userId") Long userId);
+
+    /**
+     * Executes the provided bulk action.
+     *
+     * @param bulkAction list of &lt;username, action&gt; pairs
+     * @return Bulk action result.
+     */
+    @POST
+    @Path("bulk")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Executes the provided bulk action"),
+        @Description(target = DocTarget.RETURN, value = "Bulk action result")
+    })
+    BulkActionRes bulkAction(@Description("list of &lt;username, action&gt; pairs") BulkAction bulkAction);
+
+    /**
+     * Activates user matching provided userId if provided token is valid.
+     *
+     * @param userId id of user to be activated
+     * @param token validity token
+     * @return Activated user
+     */
+    @POST
+    @Path("{userId}/status/activate")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Activates user matching provided userId if provided token is valid"),
+        @Description(target = DocTarget.RETURN, value = "Activated user")
+    })
+    UserTO activate(@Description("id of user to be activated") @PathParam("userId") Long userId,
+            @Description("validity token") @QueryParam("token") String token);
+
+    /**
+     * Activates user matching provided userId if provided token is valid and propagates this update
+     * only to resources contained in the propagation request.
+     *
+     * @param userId id of user to be activated
+     * @param token validity token
+     * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
+     * @return Activated user
+     */
+    @POST
+    @Path("{userId}/status/activate/propagation")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Activates user matching provided userId if provided token is valid and propagates "
+                + "this update only to resources contained in the propagation request."),
+        @Description(target = DocTarget.RETURN, value = "Activated user")
+    })
+    UserTO activate(@Description("id of user to be activated") @PathParam("userId") Long userId,
+            @Description("validity token") @QueryParam("token") String token,
+            @Description("propagation request on internal storage or on 0+ external resources"
+            ) PropagationRequestTO propagationRequestTO);
+
+    /**
+     * Activates user matching provided username if provided token is valid.
+     *
+     * @param username username of user to be activated
+     * @param token validity token
+     * @return Activated user
+     */
+    @POST
+    @Path("activateByUsername/{username}")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Activates user matching provided username if provided token is valid"),
+        @Description(target = DocTarget.RETURN, value = "Activated user")
+    })
+    UserTO activateByUsername(@Description("username of user to be activated") @PathParam("username") String username,
+            @Description("validity token") @QueryParam("token") String token);
+
+    /**
+     * Activates user matching provided username if provided token is valid and propagates this update
+     * only to resources contained in the propagation request.
+     *
+     * @param username username of user to be activated
+     * @param token validity token
+     * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
+     * @return Activated user
+     */
+    @POST
+    @Path("activateByUsername/{username}/propagation")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Activates user matching provided username if provided token is valid and propagates "
+                + "this update only to resources contained in the propagation request."),
+        @Description(target = DocTarget.RETURN, value = "Activated user")
+    })
+    UserTO activateByUsername(@Description("username of user to be activated") @PathParam("username") String username,
+            @Description("validity token") @QueryParam("token") String token,
+            @Description("propagation request on internal storage or on 0+ external resources"
+            ) PropagationRequestTO propagationRequestTO);
+
+    /**
+     * Suspends user matching provided userId.
+     *
+     * @param userId id of user to be suspended
+     * @return Suspended user
+     */
+    @POST
     @Path("{userId}/status/suspend")
-    UserTO suspend(@PathParam("userId") long userId);
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Suspends user matching provided userId"),
+        @Description(target = DocTarget.RETURN, value = "Suspended user")
+    })
+    UserTO suspend(@Description("id of user to be suspended") @PathParam("userId") Long userId);
 
-    @PUT
+    /**
+     * Suspend user matching provided userId and propagates this update only to resources contained in the
+     * propagation request.
+     *
+     * @param userId id of user to be activated
+     * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
+     * @return Suspended user
+     */
+    @POST
     @Path("{userId}/status/suspend/propagation")
-    UserTO suspend(@PathParam("userId") long userId, PropagationRequestTO propagationRequestTO);
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Suspend user matching provided userId and propagates this "
+                + "update only to resources contained in the propagation request"),
+        @Description(target = DocTarget.RETURN, value = "Suspended user")
+    })
+    UserTO suspend(@Description("id of user to be suspended") @PathParam("userId") Long userId,
+            @Description("propagation request on internal storage or on 0+ external resources"
+            ) PropagationRequestTO propagationRequestTO);
 
-    @PUT
+    /**
+     * Suspends user matching provided username.
+     *
+     * @param username username of user to be suspended
+     * @return Suspended user
+     */
+    @POST
     @Path("suspendByUsername/{username}")
-    UserTO suspendByUsername(@PathParam("username") String username);
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Suspends user matching provided username"),
+        @Description(target = DocTarget.RETURN, value = "Suspended user")
+    })
+    UserTO suspendByUsername(@Description("username of user to be suspended") @PathParam("username") String username);
 
-    @PUT
+    /**
+     * Suspend user matching provided username and propagates this update only to resources contained in the
+     * propagation request.
+     *
+     * @param username username of user to be activated
+     * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
+     * @return Suspended user
+     */
+    @POST
     @Path("suspendByUsername/{username}/propagation")
-    UserTO suspendByUsername(@PathParam("username") String username, PropagationRequestTO propagationRequestTO);
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Suspend user matching provided username and propagates this "
+                + "update only to resources contained in the propagation request"),
+        @Description(target = DocTarget.RETURN, value = "Suspended user")
+    })
+    UserTO suspendByUsername(@Description("username of user to be suspended") @PathParam("username") String username,
+            @Description("propagation request on internal storage or on 0+ external resources"
+            ) PropagationRequestTO propagationRequestTO);
 
-    @PUT
-    @Path("{userId}")
-    UserTO update(@PathParam("userId") Long userId, UserMod userMod);
+    /**
+     * Reactivates user matching provided userId.
+     *
+     * @param userId id of user to be reactivated
+     * @return Reactivated user
+     */
+    @POST
+    @Path("{userId}/status/reactivate")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Reactivates user matching provided userId"),
+        @Description(target = DocTarget.RETURN, value = "Reactivated user")
+    })
+    UserTO reactivate(@Description("id of user to be reactivated") @PathParam("userId") Long userId);
+
+    /**
+     * Reactivates user matching provided userId and propagates this update only to resources contained in the
+     * propagation request.
+     *
+     * @param userId id of user to be activated
+     * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
+     * @return Reactivated user
+     */
+    @POST
+    @Path("{userId}/status/reactivate/propagation")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Reactivates user matching provided userId and propagates this update only to resources "
+                + "contained in the propagation request"),
+        @Description(target = DocTarget.RETURN, value = "Reactivated user")
+    })
+    UserTO reactivate(@Description("id of user to be reactivated") @PathParam("userId") Long userId,
+            @Description("propagation request on internal storage or on 0+ external resources"
+            ) PropagationRequestTO propagationRequestTO);
 
+    /**
+     * Reactivates user matching provided username.
+     *
+     * @param username username of user to be reactivated
+     * @return Reactivated user
+     */
     @POST
-    @Path("bulk")
-    BulkActionRes bulkAction(BulkAction bulkAction);
+    @Path("reactivateByUsername/{username}")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Reactivates user matching provided username"),
+        @Description(target = DocTarget.RETURN, value = "Reactivated user")
+    })
+    UserTO reactivateByUsername(
+            @Description("username of user to be reactivated") @PathParam("username") String username);
 
     /**
-     * Unlinks user and the given external resources specified by <tt>propagationTargetsTO</tt> parameter.
+     * Reactivates user matching provided username and propagates this update only to resources contained in the
+     * propagation request.
      *
-     * @param userId user id.
-     * @param propagationTargetsTO resource names.
-     * @return updated user.
+     * @param username username of user to be activated
+     * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
+     * @return Reactivated user
+     */
+    @POST
+    @Path("reactivateByUsername/{username}/propagation")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Reactivates user matching provided username and propagates this update only to resources "
+                + "contained in the propagation request"),
+        @Description(target = DocTarget.RETURN, value = "Reactivated user")
+    })
+    UserTO reactivateByUsername(
+            @Description("username of user to be reactivated") @PathParam("username") String username,
+            @Description("propagation request on internal storage or on 0+ external resources"
+            ) PropagationRequestTO propagationRequestTO);
+
+    /**
+     * Unlinks user from the given external resources.
+     *
+     * @param userId id of user to be unlinked
+     * @param propagationTargetsTO external resources to be used for propagation-related operations
+     * @return Updated user
      */
     @PUT
     @Path("{userId}/unlink")
-    UserTO unlink(@PathParam("userId") Long userId, PropagationTargetsTO propagationTargetsTO);
+    @Descriptions({
+        @Description(target = DocTarget.METHOD, value = "Unlinks user from the given external resources"),
+        @Description(target = DocTarget.RETURN, value = "Updated user")
+    })
+    UserTO unlink(@Description("id of user to be unlinked") @PathParam("userId") Long userId,
+            @Description("external resources to be used for propagation-related operations"
+            ) PropagationTargetsTO propagationTargetsTO);
 
     /**
-     * Unassigns resources to the given user (performs unlink + de-provision).
+     * De-provision user from the given external resources without unlinking.
      *
-     * @param userId user id.
-     * @param propagationTargetsTO resources to be unassigned.
-     * @return updated user.
+     * @param userId id of user to be de-provisioned
+     * @param propagationTargetsTO external resources to be used for propagation-related operations
+     * @return Updated user
      */
     @PUT
-    @Path("{userId}/unassign")
-    UserTO unassign(@PathParam("userId") Long userId, PropagationTargetsTO propagationTargetsTO);
+    @Path("{userId}/deprovision")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "De-provision user from the given external resources without unlinking"),
+        @Description(target = DocTarget.RETURN, value = "Updated user")
+    })
+    UserTO deprovision(@Description("id of user to be de-provisioned") @PathParam("userId") Long userId,
+            @Description("De-provision user from the given external resources without unlinking"
+            ) PropagationTargetsTO propagationTargetsTO);
 
     /**
-     * De-provision user from the given resources without unlinking.
+     * Unassigns (unlink + de-provision) user from the given external resources.
      *
-     * @param userId user id of the user to be de-provisioned.
-     * @param propagationTargetsTO resource names.
-     * @return updated user.
+     * @param userId id of user to be unassigned
+     * @param propagationTargetsTO external resources to be used for propagation-related operations
+     * @return Updated user
      */
     @PUT
-    @Path("{userId}/deprovision")
-    UserTO deprovision(@PathParam("userId") Long userId, PropagationTargetsTO propagationTargetsTO);
+    @Path("{userId}/unassign")
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "Unassigns (unlink + de-provision) user from the given external resources"),
+        @Description(target = DocTarget.RETURN, value = "Updated user")
+    })
+    UserTO unassign(@Description("id of user to be unassigned") @PathParam("userId") Long userId,
+            @Description("De-provision user from the given external resources without unlinking"
+            ) PropagationTargetsTO propagationTargetsTO);
+
 }

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java Wed Oct 23 11:16:23 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.common.services;
 
+import org.apache.syncope.common.types.WorkflowTasks;
 import javax.ws.rs.GET;
 import javax.ws.rs.PUT;
 import javax.ws.rs.Path;

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationTargetsTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationTargetsTO.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationTargetsTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationTargetsTO.java Wed Oct 23 11:16:23 2013
@@ -28,7 +28,7 @@ import javax.xml.bind.annotation.XmlType
 import org.apache.syncope.common.AbstractBaseBean;
 
 /**
- * Propagation request on internal storage or on 0+ external resources.
+ * External resources to be used for propagation-related operations.
  */
 @XmlRootElement(name = "propagationTargets")
 @XmlType

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/package-info.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/package-info.java?rev=1534986&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/package-info.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/package-info.java Wed Oct 23 11:16:23 2013
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+@XmlSchema(namespace = SyncopeConstants.NAMESPACE)
+package org.apache.syncope.common.to;
+
+import javax.xml.bind.annotation.XmlSchema;
+import org.apache.syncope.common.SyncopeConstants;

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AuditLoggerName.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AuditLoggerName.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AuditLoggerName.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AuditLoggerName.java Wed Oct 23 11:16:23 2013
@@ -18,35 +18,24 @@
  */
 package org.apache.syncope.common.types;
 
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
 import java.text.ParseException;
 
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.AbstractBaseBean;
 import org.apache.syncope.common.types.AuditElements.Category;
 import org.apache.syncope.common.types.AuditElements.Result;
 
-@XmlType
-@XmlRootElement
 public class AuditLoggerName extends AbstractBaseBean {
 
     private static final long serialVersionUID = -647989486671786839L;
 
     private final Category category;
 
-    @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
     private final Enum<?> subcategory;
 
     private final Result result;
 
-    @JsonCreator
-    public AuditLoggerName(@JsonProperty("category") final Category category,
-            @JsonProperty("subcategory") final Enum<?> subcategory, @JsonProperty("result") final Result result)
+    public AuditLoggerName(final Category category, final Enum<?> subcategory, final Result result)
             throws IllegalArgumentException {
 
         if (category == null || subcategory == null || result == null) {

Copied: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ReportletConfClasses.java (from r1533338, syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportletConfClasses.java)
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ReportletConfClasses.java?p2=syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ReportletConfClasses.java&p1=syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportletConfClasses.java&r1=1533338&r2=1534986&rev=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportletConfClasses.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ReportletConfClasses.java Wed Oct 23 11:16:23 2013
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.syncope.common.services;
+package org.apache.syncope.common.types;
 
 import java.util.ArrayList;
 import java.util.Collection;

Copied: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowTasks.java (from r1533338, syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowTasks.java)
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowTasks.java?p2=syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowTasks.java&p1=syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowTasks.java&r1=1533338&r2=1534986&rev=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowTasks.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowTasks.java Wed Oct 23 11:16:23 2013
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.syncope.common.services;
+package org.apache.syncope.common.types;
 
 import java.util.ArrayList;
 import java.util.Collection;

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/package-info.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/package-info.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/package-info.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/package-info.java Wed Oct 23 11:16:23 2013
@@ -16,4 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+@XmlSchema(namespace = SyncopeConstants.NAMESPACE)
 package org.apache.syncope.common.types;
+
+import javax.xml.bind.annotation.XmlSchema;
+import org.apache.syncope.common.SyncopeConstants;

Modified: syncope/trunk/common/src/test/java/org/apache/syncope/common/JSONTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/test/java/org/apache/syncope/common/JSONTest.java?rev=1534986&r1=1534526&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/common/src/test/java/org/apache/syncope/common/JSONTest.java (original)
+++ syncope/trunk/common/src/test/java/org/apache/syncope/common/JSONTest.java Wed Oct 23 11:16:23 2013
@@ -35,8 +35,6 @@ import org.apache.syncope.common.search.
 import org.apache.syncope.common.to.ConfigurationTO;
 import org.apache.syncope.common.to.ReportTO;
 import org.apache.syncope.common.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.types.AuditElements;
-import org.apache.syncope.common.types.AuditLoggerName;
 import org.junit.Test;
 
 public class JSONTest {
@@ -118,18 +116,4 @@ public class JSONTest {
         ReportTO actual = mapper.readValue(writer.toString(), ReportTO.class);
         assertEquals(report, actual);
     }
-
-    @Test
-    public void testAuditLoggerName() throws IOException {
-        AuditLoggerName auditLoggerName = new AuditLoggerName(AuditElements.Category.report,
-                AuditElements.ReportSubCategory.create, AuditElements.Result.failure);
-
-        ObjectMapper mapper = new ObjectMapper();
-
-        StringWriter writer = new StringWriter();
-        mapper.writeValue(writer, auditLoggerName);
-
-        AuditLoggerName actual = mapper.readValue(writer.toString(), AuditLoggerName.class);
-        assertEquals(auditLoggerName, actual);
-    }
 }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.java Wed Oct 23 11:16:23 2013
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 import java.util.List;
 import javax.ws.rs.core.Response;
 import org.apache.syncope.common.services.ReportService;
-import org.apache.syncope.common.services.ReportletConfClasses;
+import org.apache.syncope.common.types.ReportletConfClasses;
 import org.apache.syncope.common.to.ReportTO;
 import org.apache.syncope.common.types.ReportExecExportFormat;
 import org.apache.syncope.common.validation.SyncopeClientCompositeException;

Added: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/WADLServlet.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/WADLServlet.java?rev=1534986&view=auto
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/WADLServlet.java (added)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/WADLServlet.java Wed Oct 23 11:16:23 2013
@@ -0,0 +1,96 @@
+/*
+ * 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.core.rest;
+
+import java.io.IOException;
+import java.net.URL;
+import java.rmi.ServerException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.cocoon.pipeline.CachingPipeline;
+import org.apache.cocoon.pipeline.Pipeline;
+import org.apache.cocoon.sax.SAXPipelineComponent;
+import org.apache.cocoon.sax.component.XMLGenerator;
+import org.apache.cocoon.sax.component.XMLSerializer;
+import org.apache.cocoon.sax.component.XSLTTransformer;
+
+public class WADLServlet extends HttpServlet {
+
+    private static final long serialVersionUID = -6737005675471095560L;
+
+    private static final Pattern SCHEMA_PATTERN = Pattern.compile("/schema_(.*)_(.*)\\.html");
+
+    /**
+     * Handles the HTTP <code>GET</code> method.
+     *
+     * @param request servlet request
+     * @param response servlet response
+     * @throws ServletException if a servlet-specific error occurs
+     * @throws IOException if an I/O error occurs
+     */
+    @Override
+    protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
+            throws ServletException, IOException {
+
+        String requestURI = request.getRequestURI().substring(
+                request.getRequestURI().indexOf(request.getServletPath()) + request.getServletPath().length());
+        Matcher schemaMatcher = SCHEMA_PATTERN.matcher(requestURI);
+
+        Pipeline<SAXPipelineComponent> pipeline = new CachingPipeline<SAXPipelineComponent>();
+        final String wadlURL = request.getRequestURL().
+                substring(0, request.getRequestURL().indexOf("/doc")) + "/?_wadl";
+        pipeline.addComponent(new XMLGenerator(new URL(wadlURL)));
+        if ("/".equals(requestURI)) {
+            XSLTTransformer xslt = new XSLTTransformer(getClass().getResource("/wadl2html/index.xsl"));
+
+            Map<String, Object> parameters = new HashMap<String, Object>();
+            parameters.put("contextPath", request.getContextPath());
+            xslt.setParameters(parameters);
+
+            pipeline.addComponent(xslt);
+        } else if (schemaMatcher.matches()) {
+            XSLTTransformer xslt = new XSLTTransformer(getClass().getResource("/wadl2html/schema.xsl"));
+
+            Map<String, Object> parameters = new HashMap<String, Object>();
+            parameters.put("contextPath", request.getContextPath());
+            parameters.put("schema-position", schemaMatcher.group(1));
+            parameters.put("schema-prefix", schemaMatcher.group(2));
+            xslt.setParameters(parameters);
+
+            pipeline.addComponent(xslt);
+        } else {
+            throw new ServerException("URL not supported: " + request.getRequestURI());
+        }
+
+        pipeline.addComponent(XMLSerializer.createHTML4Serializer());
+        pipeline.setup(response.getOutputStream());
+        try {
+            pipeline.execute();
+        } catch (Exception e) {
+            throw new ServletException(e);
+        }
+    }
+
+}

Propchange: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/WADLServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/WADLServlet.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/WADLServlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java Wed Oct 23 11:16:23 2013
@@ -26,7 +26,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.StreamingOutput;
 import org.apache.syncope.common.SyncopeConstants;
 import org.apache.syncope.common.services.ReportService;
-import org.apache.syncope.common.services.ReportletConfClasses;
+import org.apache.syncope.common.types.ReportletConfClasses;
 import org.apache.syncope.common.to.ReportExecTO;
 import org.apache.syncope.common.to.ReportTO;
 import org.apache.syncope.common.types.ReportExecExportFormat;

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java Wed Oct 23 11:16:23 2013
@@ -42,12 +42,12 @@ public class UserServiceImpl extends Abs
     private UserController controller;
 
     @Override
-    public UserTO activate(final long userId, final String token) {
+    public UserTO activate(final Long userId, final String token) {
         return controller.activate(userId, token);
     }
 
     @Override
-    public UserTO activate(final long userId, final String token, final PropagationRequestTO propagationRequestTO) {
+    public UserTO activate(final Long userId, final String token, final PropagationRequestTO propagationRequestTO) {
         return controller.activate(userId, token, propagationRequestTO);
     }
 
@@ -93,12 +93,12 @@ public class UserServiceImpl extends Abs
     }
 
     @Override
-    public UserTO reactivate(final long userId) {
+    public UserTO reactivate(final Long userId) {
         return controller.reactivate(userId);
     }
 
     @Override
-    public UserTO reactivate(final long userId, final PropagationRequestTO propagationRequestTO) {
+    public UserTO reactivate(final Long userId, final PropagationRequestTO propagationRequestTO) {
         return controller.reactivate(userId, propagationRequestTO);
     }
 
@@ -144,12 +144,12 @@ public class UserServiceImpl extends Abs
     }
 
     @Override
-    public UserTO suspend(final long userId) {
+    public UserTO suspend(final Long userId) {
         return controller.suspend(userId);
     }
 
     @Override
-    public UserTO suspend(final long userId, final PropagationRequestTO propagationRequestTO) {
+    public UserTO suspend(final Long userId, final PropagationRequestTO propagationRequestTO) {
         return controller.suspend(userId, propagationRequestTO);
     }
 

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java Wed Oct 23 11:16:23 2013
@@ -21,7 +21,7 @@ package org.apache.syncope.core.services
 import javax.ws.rs.BadRequestException;
 
 import org.apache.syncope.common.services.WorkflowService;
-import org.apache.syncope.common.services.WorkflowTasks;
+import org.apache.syncope.common.types.WorkflowTasks;
 import org.apache.syncope.common.to.WorkflowDefinitionTO;
 import org.apache.syncope.common.types.AttributableType;
 import org.apache.syncope.core.rest.controller.WorkflowController;

Modified: syncope/trunk/core/src/main/resources/restContext.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/restContext.xml?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/core/src/main/resources/restContext.xml (original)
+++ syncope/trunk/core/src/main/resources/restContext.xml Wed Oct 23 11:16:23 2013
@@ -37,6 +37,13 @@ under the License.
   <context:component-scan base-package="org.apache.syncope.core.services"/>
 
   <bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
+    <property name="namespacePrefixes">
+      <map>
+        <entry key="http://syncope.apache.org/1.2">
+          <value>syncope</value>
+        </entry>
+      </map>      
+    </property>
     <property name="depthProperties">
       <bean id="depthProperties" class="org.apache.cxf.staxutils.DocumentDepthProperties">
         <property name="innerElementCountThreshold" value="500"/>
@@ -68,7 +75,16 @@ under the License.
 
   <bean id="exceptionMapper" class="org.apache.syncope.core.rest.utils.RestServiceExceptionMapper"/>
 
-  <jaxrs:server id="restContainer" address="/">
+  <bean id="wadlGenerator" class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
+    <property name="applicationTitle" value="Apache Syncope ${project.version}"/>
+    <property name="namespacePrefix" value="syncope"/>
+    <property name="linkJsonToXmlSchema" value="true"/>
+    <property name="useJaxbContextForQnames" value="true"/>
+    <property name="ignoreMessageWriters" value="true"/>
+    <property name="addResourceAndMethodIds" value="true"/>
+  </bean>
+  
+  <jaxrs:server id="restContainer" address="/" staticSubresourceResolution="true">
     <jaxrs:serviceBeans>
       <ref bean="connectorServiceImpl"/>
       <ref bean="configurationServiceImpl"/>
@@ -87,12 +103,13 @@ under the License.
       <ref bean="userWorkflowServiceImpl"/>
     </jaxrs:serviceBeans>
     <jaxrs:resourceComparator>
-      <bean id="myServiceComparator" class="org.apache.syncope.core.rest.utils.QueryResourceInfoComparator"/>
+      <bean id="queryResourceInfoComparator" class="org.apache.syncope.core.rest.utils.QueryResourceInfoComparator"/>
     </jaxrs:resourceComparator>
     <jaxrs:providers>
       <ref bean="jaxbProvider"/>
       <ref bean="jsonProvider"/>
       <ref bean="exceptionMapper"/>
+      <ref bean="wadlGenerator"/>
     </jaxrs:providers>
     <jaxrs:extensionMappings>
       <entry key="json" value="application/json;charset=UTF-8"/>

Propchange: syncope/trunk/core/src/main/resources/wadl2html/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Oct 23 11:16:23 2013
@@ -0,0 +1 @@
+.index.xsl.swp

Added: syncope/trunk/core/src/main/resources/wadl2html/index.xsl
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/wadl2html/index.xsl?rev=1534986&view=auto
==============================================================================
--- syncope/trunk/core/src/main/resources/wadl2html/index.xsl (added)
+++ syncope/trunk/core/src/main/resources/wadl2html/index.xsl Wed Oct 23 11:16:23 2013
@@ -0,0 +1,439 @@
+<?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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:xalan="http://xml.apache.org/xalan"
+                xmlns:wadl="http://wadl.dev.java.net/2009/02"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                exclude-result-prefixes="xalan wadl xs"
+                version="1.0">
+  
+  <xsl:param name="contextPath"/>
+  
+  <xsl:variable name="namespaces">       
+    <xsl:for-each select="/*/namespace::*">
+      <namespace prefix="{name()}" url="{.}"/>            
+    </xsl:for-each>
+  </xsl:variable>
+
+  <xsl:variable name="namespacePos">       
+    <xsl:for-each select="//xs:schema">
+      <namespace url="{@targetNamespace}" position="{position()}"/>
+    </xsl:for-each>
+  </xsl:variable>
+
+  <xsl:template match="/wadl:application">  
+    <html lang="en">
+      <head>
+        <meta charset="utf-8"/>
+        <title>          
+          <xsl:value-of select="wadl:doc/@title"/>
+        </title>
+
+        <link rel="stylesheet" href="{$contextPath}/css/jquery-ui.css"/>
+        <link rel="stylesheet" href="{$contextPath}/css/style.css"/>
+
+        <script src="{$contextPath}/js/jquery.js">          
+        </script>
+        <script src="{$contextPath}/js/jquery-ui.js">          
+        </script>
+        <script>
+          //<![CDATA[
+          $(function() {
+          //]]>
+          <xsl:for-each select="wadl:resources/wadl:resource">
+            <xsl:sort select="@path"/>
+            <xsl:text>$( "#accordion-</xsl:text>
+            <xsl:value-of select="position()"/>
+            <xsl:text>" ).accordion({
+              collapsible: true,
+              heightStyle: "content",
+              active: false
+              });
+            </xsl:text>
+            
+            <xsl:variable name="parentResourcePath" select="translate(@path, '/{}', '___')"/>
+            <xsl:call-template name="dialog-init">
+              <xsl:with-param name="resourcePath" select="$parentResourcePath"/>
+            </xsl:call-template>
+            <xsl:for-each select="wadl:resource">
+              <xsl:variable name="childResourcePath" select="translate(@path, '/{}', '___')"/>
+              <xsl:call-template name="dialog-init">
+                <xsl:with-param name="resourcePath" select="concat($parentResourcePath, $childResourcePath)"/>
+              </xsl:call-template>
+            </xsl:for-each>
+          </xsl:for-each>
+          //<![CDATA[
+          $( "#tabs" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" );
+          $( "#tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
+          });
+ 
+          /*
+          * hoverIntent | Copyright 2011 Brian Cherne
+          * http://cherne.net/brian/resources/jquery.hoverIntent.html
+          * modified by the jQuery UI team
+          */
+          $.event.special.hoverintent = {
+          setup: function() {
+          $( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler );
+          },
+          teardown: function() {
+          $( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
+          },
+          handler: function( event ) {
+          var currentX, currentY, timeout,
+          args = arguments,
+          target = $( event.target ),
+          previousX = event.pageX,
+          previousY = event.pageY;
+ 
+          function track( event ) {
+          currentX = event.pageX;
+          currentY = event.pageY;
+          };
+ 
+          function clear() {
+          target
+          .unbind( "mousemove", track )
+          .unbind( "mouseout", clear );
+          clearTimeout( timeout );
+          }
+ 
+          function handler() {
+          var prop,
+          orig = event;
+ 
+          if ( ( Math.abs( previousX - currentX ) +
+          Math.abs( previousY - currentY ) ) < 7 ) {
+          clear();
+ 
+          event = $.Event( "hoverintent" );
+          for ( prop in orig ) {
+          if ( !( prop in event ) ) {
+          event[ prop ] = orig[ prop ];
+          }
+          }
+          // Prevent accessing the original event since the new event
+          // is fired asynchronously and the old event is no longer
+          // usable (#6028)
+          delete event.originalEvent;
+ 
+          target.trigger( event );
+          } else {
+          previousX = currentX;
+          previousY = currentY;
+          timeout = setTimeout( handler, 100 );
+          }
+          }
+ 
+          timeout = setTimeout( handler, 100 );
+          target.bind({
+          mousemove: track,
+          mouseout: clear
+          });
+          }
+          };
+          //]]>
+        </script>
+      </head>
+      <body>
+        <h1>
+          <xsl:value-of select="wadl:doc/@title"/>
+        </h1>        
+        
+        <h3>Namespaces</h3>                                
+        <table>
+          <tr>
+            <th>Prefix</th>
+            <th>URI</th>
+            <th>XSD</th>
+          </tr>
+          <xsl:apply-templates select="wadl:grammars/xs:schema"/>
+        </table>
+                                                                                              
+        <h3>REST resources</h3>                                
+        <div id="tabs">
+          <ul>
+            <xsl:for-each select="wadl:resources/wadl:resource">
+              <xsl:sort select="@path"/>
+              <li>
+                <a href="#tabs-{position()}">
+                  <xsl:value-of select="@path"/>
+                </a>
+              </li>
+            </xsl:for-each>
+          </ul>
+          
+          <xsl:apply-templates select="wadl:resources/wadl:resource">
+            <xsl:sort select="@path"/>            
+          </xsl:apply-templates>
+        </div>
+      </body>
+    </html>       
+  </xsl:template>
+  
+  <xsl:template name="dialog-init">
+    <xsl:param name="resourcePath"/>
+    
+    <xsl:for-each select="wadl:method">
+      <xsl:text>$(function() {
+        $( "#dialog</xsl:text>
+      <xsl:value-of select="$resourcePath"/>_<xsl:value-of select="position()"/>
+      <xsl:text>" ).dialog({
+        autoOpen: false,
+        modal: true,
+        height: "auto",
+        width: "auto",
+        resizable: false
+        });
+ 
+        $( "#opener</xsl:text>
+      <xsl:value-of select="$resourcePath"/>_<xsl:value-of select="position()"/>
+      <xsl:text>" ).click(function() {
+        $( "#dialog</xsl:text>
+      <xsl:value-of select="$resourcePath"/>_<xsl:value-of select="position()"/>
+      <xsl:text>" ).dialog( "open" );
+        });
+        });
+      </xsl:text>
+    </xsl:for-each>
+  </xsl:template>
+  
+  <xsl:template match="xs:schema">
+    <xsl:variable name="targetNamespace" select="@targetNamespace"/>
+
+    <xsl:variable name="prefix" 
+                  select="xalan:nodeset($namespaces)/namespace[@url = $targetNamespace]/@prefix"/>
+
+    <tr>
+      <td>
+        <xsl:value-of select="$prefix"/>
+      </td>
+      <td>
+        <xsl:value-of select="@targetNamespace"/>
+      </td>
+      <td>
+        <a href="schema_{position()}_{$prefix}.html" 
+           onClick="window.open('', 'schema', '', true).focus();" target="schema">
+          <xsl:value-of select="$prefix"/>.xsd</a>
+      </td>
+    </tr>
+  </xsl:template>
+    
+  <xsl:template match="wadl:resource">
+    <div id="tabs-{position()}">
+      <h2>
+        <xsl:value-of select="@path"/>
+      </h2>
+      
+      <xsl:if test="string-length(wadl:doc) &gt; 0">
+        <p>
+          <xsl:value-of select="wadl:doc/text()" disable-output-escaping="yes"/>
+        </p>
+      </xsl:if>
+            
+      <xsl:call-template name="parameters"/>
+      
+      <xsl:call-template name="methods">
+        <xsl:with-param name="resourcePath" select="@path"/>
+      </xsl:call-template>
+      
+      <xsl:variable name="parentPath" select="@path"/>
+      <div id="accordion-{position()}">
+        <xsl:for-each select="descendant::*[local-name() = 'resource']">
+          <xsl:sort select="@path"/>
+          <xsl:call-template name="subresource">
+            <xsl:with-param name="parentPath" select="$parentPath"/>
+          </xsl:call-template>
+        </xsl:for-each>
+      </div>
+    </div>
+  </xsl:template>
+ 
+  <xsl:template name="methods">
+    <xsl:param name="resourcePath"/>
+
+    <xsl:variable name="escapedPath" select="translate($resourcePath, '/{}', '___')"/>
+    <div class="methods">
+      <xsl:for-each select="wadl:method">
+        <button id="opener{$escapedPath}_{position()}">
+          <xsl:value-of select="@name"/>
+          <xsl:if test="string-length(@id) &gt; 0">
+            <br/>
+            (<em>
+              <xsl:value-of select="@id"/>
+            </em>)
+          </xsl:if>
+        </button>
+        <div id="dialog{$escapedPath}_{position()}" title="{@name} {$resourcePath}">
+          <xsl:apply-templates select="."/>
+        </div>
+      </xsl:for-each>     
+    </div>           
+  </xsl:template>
+  
+  <xsl:template name="subresource">
+    <xsl:param name="parentPath"/>
+    
+    <h3>
+      <xsl:value-of select="@path"/>
+    </h3>
+    
+    <div>
+      <xsl:if test="string-length(wadl:doc) &gt; 0">
+        <p>
+          <xsl:value-of select="wadl:doc/text()" disable-output-escaping="yes"/>
+        </p>
+      </xsl:if>
+
+      <xsl:call-template name="parameters"/>
+
+      <xsl:call-template name="methods">
+        <xsl:with-param name="resourcePath" select="concat($parentPath, @path)"/>
+      </xsl:call-template>
+    </div>
+  </xsl:template>
+ 
+  <xsl:template match="wadl:method">
+    <xsl:if test="string-length(wadl:doc) &gt; 0">
+      <p>
+        <xsl:value-of select="wadl:doc/text()" disable-output-escaping="yes"/>
+      </p>
+    </xsl:if>
+    
+    <xsl:if test="count(wadl:request/@*) + count(wadl:request/*) &gt; 0">
+      <xsl:apply-templates select="wadl:request"/>
+    </xsl:if>
+    <xsl:if test="count(wadl:response/@*) + count(wadl:response/*) &gt; 0">
+      <xsl:apply-templates select="wadl:response"/>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="wadl:request|wadl:response">
+    <xsl:call-template name="parameters"/>
+    
+    <h4>
+      R<xsl:value-of select="substring-after(local-name(), 'r')"/>
+    </h4>
+    
+    <xsl:if test="string-length(wadl:doc) &gt; 0">
+      <p>
+        <xsl:value-of select="wadl:doc/text()" disable-output-escaping="yes"/>
+      </p>
+    </xsl:if>
+    
+    <table>
+      <xsl:if test="string-length(@status) &gt;0 ">
+        <tr>
+          <td class="representation-label">Status</td>
+          <td>
+            <xsl:value-of select="@status"/>
+          </td>
+        </tr>
+      </xsl:if>
+      <xsl:if test="count(wadl:representation) &gt; 0">
+        <tr>
+          <td class="representation-label">Content type</td>
+          <td>
+            <xsl:if test="count(wadl:representation/@element) &gt; 0">
+              <xsl:choose>
+                <xsl:when test="starts-with(wadl:representation/@element, 'xs:')">
+                  <xsl:value-of select="wadl:representation/@element"/>                  
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:variable name="schema-prefix" 
+                                select="substring-before(wadl:representation/@element, ':')"/>
+                  <xsl:variable name="nsURL" 
+                                select="xalan:nodeset($namespaces)/namespace[@prefix = $schema-prefix]/@url"/>
+                  <xsl:variable name="schema-position" 
+                                select="xalan:nodeset($namespacePos)/namespace[@url = $nsURL]/@position"/>
+                  
+                  <a href="schema_{$schema-position}_{$schema-prefix}.html#{substring-after(wadl:representation/@element, ':')}"
+                     onClick="window.open('', 'schema', '', true).focus();" target="schema">
+                    <xsl:value-of select="wadl:representation/@element"/>
+                  </a>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:if>
+            <xsl:if test="count(wadl:representation/wadl:param) &gt; 0">
+              <xsl:value-of select="wadl:representation/wadl:param/@type"/>
+            </xsl:if>
+            <xsl:if test="count(wadl:representation/wadl:doc) &gt; 0">
+              <br/>
+              <xsl:value-of select="wadl:representation/wadl:doc/text()" disable-output-escaping="yes"/>
+            </xsl:if>            
+          </td>
+        </tr>
+        <tr>
+          <td class="representation-label">Media types</td>
+          <td>
+            <xsl:for-each select="wadl:representation">
+              <xsl:value-of select="@mediaType"/>
+              <br/>
+            </xsl:for-each>
+          </td>
+        </tr>
+      </xsl:if>
+    </table>
+  </xsl:template>
+
+  <xsl:template name="parameters">
+    <xsl:if test="count(wadl:param) &gt; 0">
+      <h5>Parameters</h5>
+      <table>
+        <tr>
+          <th>Name</th>
+          <th>Description</th>
+          <th>Style</th>
+          <th>Type</th>
+          <th>Default</th>
+        </tr>
+        <xsl:for-each select="wadl:param">
+          <tr>
+            <td>
+              <xsl:value-of select="@name"/>
+            </td>
+            <td>
+              <xsl:value-of select="wadl:doc/text()" disable-output-escaping="yes"/>
+            </td>
+            <td>
+              <xsl:value-of select="@style"/>
+            </td>
+            <td>
+              <xsl:value-of select="@type"/>
+              <xsl:if test="count(wadl:option) &gt; 0">
+                <ul>
+                  <xsl:for-each select="wadl:option">
+                    <li>
+                      <xsl:value-of select="@value"/>
+                    </li>
+                  </xsl:for-each>
+                </ul>
+              </xsl:if>
+            </td>
+            <td>
+              <xsl:value-of select="@default"/>
+            </td>
+          </tr>
+        </xsl:for-each>
+      </table>
+    </xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: syncope/trunk/core/src/main/resources/wadl2html/index.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: syncope/trunk/core/src/main/resources/wadl2html/index.xsl
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: syncope/trunk/core/src/main/resources/wadl2html/index.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: syncope/trunk/core/src/main/resources/wadl2html/schema.xsl
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/wadl2html/schema.xsl?rev=1534986&view=auto
==============================================================================
--- syncope/trunk/core/src/main/resources/wadl2html/schema.xsl (added)
+++ syncope/trunk/core/src/main/resources/wadl2html/schema.xsl Wed Oct 23 11:16:23 2013
@@ -0,0 +1,141 @@
+<?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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:wadl="http://wadl.dev.java.net/2009/02"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                exclude-result-prefixes="wadl xs"
+                version="1.0">
+  
+  <xsl:strip-space elements="*"/>
+
+  <xsl:param name="contextPath"/>
+  <xsl:param name="schema-position"/>  
+  <xsl:param name="schema-prefix"/>  
+  
+  <xsl:template match="/wadl:application">  
+    <html lang="en">
+      <head>
+        <meta charset="utf-8"/>
+        <title>          
+          <xsl:value-of select="wadl:doc/@title"/>
+        </title>
+                  
+        <link rel="stylesheet" href="{$contextPath}/css/highlight.css"/>
+        
+        <script src="{$contextPath}/js/highlight.pack.js">           
+        </script>
+        <script>
+          hljs.initHighlightingOnLoad();
+        </script>
+      </head>
+      <body>        
+        <pre>
+          <code class="xml">
+            <xsl:apply-templates select="//xs:schema[position() = $schema-position]" mode="verb"/>
+          </code>
+        </pre>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template match="*|@*" mode="verb">
+    <xsl:variable name="node-type">
+      <xsl:call-template name="node-type"/>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$node-type='element'">
+        <xsl:for-each select="ancestor::node()">
+          <xsl:if test="position() &gt; 3">
+            <xsl:text>&#160;&#160;</xsl:text>
+          </xsl:if>
+        </xsl:for-each>
+
+        <xsl:choose>
+          <xsl:when test="name() = 'xs:complexType' or name() = 'xs:simpleType'">
+            <a name="int_{@name}">
+              <xsl:text>&lt;</xsl:text>
+              <xsl:value-of select="name()"/>
+            </a>          
+          </xsl:when>
+          <xsl:when test="name() = 'xs:element'">
+            <a name="{@name}">
+              <xsl:text>&lt;</xsl:text>
+              <xsl:value-of select="name()"/>
+            </a>          
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>&lt;</xsl:text>
+            <xsl:value-of select="name()"/>
+          </xsl:otherwise>
+        </xsl:choose>
+        
+        <xsl:apply-templates select="@*" mode="verb"/>        
+
+        <xsl:choose>
+          <xsl:when test="count(descendant::node()) = 0">
+            <xsl:text>/&gt;&#10;</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>&gt;&#10;</xsl:text>
+            
+            <xsl:apply-templates mode="verb"/>
+                
+            <xsl:for-each select="ancestor::node()">
+              <xsl:if test="position() &gt; 3">
+                <xsl:text>&#160;&#160;</xsl:text>
+              </xsl:if>
+            </xsl:for-each>
+
+            <xsl:text>&lt;/</xsl:text>
+            <xsl:value-of select="name()"/>
+            <xsl:text>&gt;&#10;</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>                        
+      </xsl:when>
+      <xsl:when test="$node-type='text'">
+        <xsl:value-of select="self::text()"/>
+      </xsl:when>
+      <xsl:when test="$node-type='attribute'">
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="name()"/>
+        <xsl:text>="</xsl:text>
+        <xsl:choose>
+          <xsl:when test="contains(., ':') and not(starts-with(., 'xs:'))">
+            <a href="#int_{substring-after(., ':')}">
+              <xsl:value-of select="."/>                          
+            </a>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="."/>            
+          </xsl:otherwise>
+        </xsl:choose>
+        <xsl:text>"</xsl:text>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="node-type">
+    <xsl:param name="node" select="."/>
+    <xsl:apply-templates mode="nodetype" select="$node"/>
+  </xsl:template>
+  <xsl:template mode="nodetype" match="*">element</xsl:template>
+  <xsl:template mode="nodetype" match="@*">attribute</xsl:template>
+  <xsl:template mode="nodetype" match="text()">text</xsl:template>
+</xsl:stylesheet>

Propchange: syncope/trunk/core/src/main/resources/wadl2html/schema.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: syncope/trunk/core/src/main/resources/wadl2html/schema.xsl
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: syncope/trunk/core/src/main/resources/wadl2html/schema.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: syncope/trunk/core/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/webapp/WEB-INF/web.xml?rev=1534986&r1=1534985&r2=1534986&view=diff
==============================================================================
--- syncope/trunk/core/src/main/webapp/WEB-INF/web.xml (original)
+++ syncope/trunk/core/src/main/webapp/WEB-INF/web.xml Wed Oct 23 11:16:23 2013
@@ -49,6 +49,15 @@ under the License.
     <servlet-name>CXFServlet</servlet-name>
     <url-pattern>/rest/*</url-pattern>
   </servlet-mapping>
+  <servlet>
+    <servlet-name>WADLServlet</servlet-name>
+    <servlet-class>org.apache.syncope.core.rest.WADLServlet</servlet-class>
+    <load-on-startup>2</load-on-startup> 
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>WADLServlet</servlet-name>
+    <url-pattern>/rest/doc/*</url-pattern>
+  </servlet-mapping>
 
   <filter>
     <filter-name>encodingFilter</filter-name>



Mime
View raw message