You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/10/09 11:40:01 UTC
[2/3] syncope git commit: [SYNCOPE-704] syncope-ext-swagger-ui
provided; CXF's Swagger2Feature and Swagger's SwaggerSerializer extended
[SYNCOPE-704] syncope-ext-swagger-ui provided; CXF's Swagger2Feature and Swagger's SwaggerSerializer extended
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/5934d54f
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/5934d54f
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/5934d54f
Branch: refs/heads/master
Commit: 5934d54f8d28dd73d9ee1cee21ec14e4209af5ba
Parents: 4cd1c1e
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Fri Oct 9 11:39:34 2015 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Fri Oct 9 11:39:34 2015 +0200
----------------------------------------------------------------------
.../common/rest/api/service/AnyService.java | 22 +--
.../rest/api/service/AnyTypeClassService.java | 2 +-
.../common/rest/api/service/AnyTypeService.java | 2 +-
.../rest/api/service/ConnectorService.java | 4 +-
.../common/rest/api/service/DomainService.java | 2 +-
.../common/rest/api/service/GroupService.java | 2 +-
.../rest/api/service/NotificationService.java | 2 +-
.../common/rest/api/service/PolicyService.java | 11 +-
.../common/rest/api/service/RealmService.java | 2 +-
.../api/service/RelationshipTypeService.java | 2 +-
.../common/rest/api/service/ReportService.java | 2 +-
.../rest/api/service/ResourceService.java | 4 +-
.../common/rest/api/service/RoleService.java | 2 +-
.../common/rest/api/service/SchemaService.java | 8 +-
.../api/service/SecurityQuestionService.java | 2 +-
.../common/rest/api/service/SyncopeService.java | 3 +
.../common/rest/api/service/TaskService.java | 5 +-
.../rest/api/service/UserSelfService.java | 14 +-
.../common/rest/api/service/UserService.java | 12 +-
.../rest/api/service/WorkflowService.java | 2 +-
core/rest-cxf/pom.xml | 5 +
.../core/rest/cxf/SyncopeSwagger2Feature.java | 137 ++++++++++++++++
.../rest/cxf/SyncopeSwaggerSerializers.java | 153 +++++++++++++++++
.../syncope/core/rest/cxf/WADLServlet.java | 50 ++++--
.../rest/cxf/service/PolicyServiceImpl.java | 6 +-
.../rest/cxf/service/SchemaServiceImpl.java | 6 +-
.../core/rest/cxf/service/TaskServiceImpl.java | 4 +-
.../main/resources/META-INF/web-fragment.xml | 4 +-
.../src/main/resources/restCXFContext.xml | 19 ++-
.../src/main/resources/wadl2html/index.xsl | 6 +-
.../console/rest/CamelRouteRestClient.java | 2 +-
.../syncope/common/lib/to/CamelRouteTO.java | 2 +
.../rest/api/service/CamelRouteService.java | 25 ++-
.../rest/cxf/service/CamelRouteServiceImpl.java | 3 +-
ext/pom.xml | 1 +
ext/swagger-ui/pom.xml | 107 ++++++++++++
.../META-INF/resources/swagger/index.html | 163 +++++++++++++++++++
fit/console-reference/pom.xml | 73 ++++++++-
fit/core-reference/pom.xml | 143 +++++++++++++++-
.../fit/core/reference/CamelRouteITCase.java | 2 +-
pom.xml | 21 ++-
41 files changed, 941 insertions(+), 96 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
index dd41f24..49899c2 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
@@ -110,8 +110,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
* Creates a new any object.
*
* @param anyTO any object to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created any object as well as the any
- * object itself enriched with propagation status information - <tt>AnyTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring Location header of created any object as well as the any
+ * object itself enriched with propagation status information - AnyTO as Entity
*/
@POST
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@@ -122,8 +122,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
* Updates any object matching the provided key.
*
* @param anyPatch modification to be applied to any object matching the provided key
- * @return <tt>Response</tt> object featuring the updated any object enriched with propagation status information
- * - <tt>AnyTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring the updated any object enriched with propagation status information
+ * - AnyTO as Entity
*/
@PATCH
@Path("{key}")
@@ -137,7 +137,7 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
* @param key any object key
* @param schemaType schema type
* @param attrTO attribute
- * @return <tt>Response</tt> object featuring the updated any object attribute - <tt>AttrTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring the updated any object attribute - as Entity
*/
@PUT
@Path("{key}/{schemaType}/{schema}")
@@ -152,8 +152,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
* Updates any object matching the provided key.
*
* @param anyTO complete update
- * @return <tt>Response</tt> object featuring the updated any object enriched with propagation status information
- * - <tt>AnyTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring the updated any object enriched with propagation status information
+ * - AnyTO as Entity
*/
@PUT
@Path("{key}")
@@ -181,8 +181,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
* Deletes any object matching provided key.
*
* @param key key of any object to be deleted
- * @return <tt>Response</tt> object featuring the deleted any object enriched with propagation status information
- * - <tt>AnyTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring the deleted any object enriched with propagation status information
+ * - AnyTO as Entity
*/
@DELETE
@Path("{key}")
@@ -194,7 +194,7 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
* Executes resource-related operations on given any object.
*
* @param patch external resources to be used for propagation-related operations
- * @return <tt>Response</tt> object featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>
+ * @return Response object featuring BulkActionResult as Entity
*/
@POST
@Path("{key}/deassociate/{action}")
@@ -206,7 +206,7 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
* Executes resource-related operations on given any object.
*
* @param patch external resources to be used for propagation-related operations
- * @return <tt>Response</tt> object featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>
+ * @return Response object featuring BulkActionResult as Entity
*/
@POST
@Path("{key}/associate/{action}")
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java
index 454652e..fff0eb5 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java
@@ -62,7 +62,7 @@ public interface AnyTypeClassService extends JAXRSService {
* Creates a new anyTypeClass.
*
* @param anyTypeClassTO anyTypeClass to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created anyTypeClass
+ * @return Response object featuring Location header of created anyTypeClass
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
index 8f01fc1..818bea4 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
@@ -62,7 +62,7 @@ public interface AnyTypeService extends JAXRSService {
* Creates a new anyType.
*
* @param anyTypeTO anyType to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created anyType
+ * @return Response object featuring Location header of created anyType
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
index 68f6bdd..686d373 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
@@ -142,7 +142,7 @@ public interface ConnectorService extends JAXRSService {
* Creates a new connector instance.
*
* @param connInstanceTO connector instance to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created connector instance
+ * @return Response object featuring Location header of created connector instance
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@@ -168,6 +168,8 @@ public interface ConnectorService extends JAXRSService {
void delete(@NotNull @PathParam("key") Long key);
/**
+ * Checks whether the connection to resource could be established.
+ *
* @param connInstanceTO connector instance to be used for connection check
*/
@POST
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java
index a37c643..9471f7a 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java
@@ -62,7 +62,7 @@ public interface DomainService extends JAXRSService {
* Creates a new domain.
*
* @param domainTO domain to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created domain
+ * @return Response object featuring Location header of created domain
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java
index 934ceff..d1e556d 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java
@@ -33,7 +33,7 @@ import org.apache.syncope.common.lib.to.GroupTO;
public interface GroupService extends AnyService<GroupTO, GroupPatch> {
/**
- * This method is similar to <tt>read()</tt>, but uses different authentication handling to ensure that a user
+ * This method is similar to read() but uses different authentication handling to ensure that a user
* can read his own groups.
*
* @return own groups
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
index c380d31..1bdfbf8 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
@@ -62,7 +62,7 @@ public interface NotificationService extends JAXRSService {
* Creates a new notification.
*
* @param notificationTO Creates a new notification.
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created notification
+ * @return Response object featuring Location header of created notification
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
index e35ef7c..c39f98a 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
@@ -67,32 +67,29 @@ public interface PolicyService extends JAXRSService {
* Create a new policy.
*
* @param policyTO Policy to be created (needs to match type)
- * @param <T> response type (extending PolicyTO)
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created policy
+ * @return Response object featuring Location header of created policy
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractPolicyTO> Response create(@NotNull T policyTO);
+ Response create(@NotNull AbstractPolicyTO policyTO);
/**
* Updates policy matching the given key.
*
* @param policyTO Policy to replace existing policy
- * @param <T> response type (extending PolicyTO)
*/
@PUT
@Path("{key}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractPolicyTO> void update(@NotNull T policyTO);
+ void update(@NotNull AbstractPolicyTO policyTO);
/**
* Delete policy matching the given key.
*
* @param key key of policy to be deleted
- * @param <T> response type (extending PolicyTO)
*/
@DELETE
@Path("{key}")
- <T extends AbstractPolicyTO> void delete(@NotNull @PathParam("key") Long key);
+ void delete(@NotNull @PathParam("key") Long key);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java
index 81111e0..fdd0b6b 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java
@@ -63,7 +63,7 @@ public interface RealmService extends JAXRSService {
*
* @param parentPath full path of the parent realm
* @param realmTO new realm.
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created realm
+ * @return Response object featuring Location header of created realm
*/
@POST
@Path("{parentPath:.*}")
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java
index 30a7a15..abfc6b6 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java
@@ -62,7 +62,7 @@ public interface RelationshipTypeService extends JAXRSService {
* Creates a new relationshipType.
*
* @param relationshipTypeTO relationshipType to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created relationshipType
+ * @return Response object featuring Location header of created relationshipType
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
index bc8b346..1f8399f 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
@@ -79,7 +79,7 @@ public interface ReportService extends JAXRSService {
* Creates a new report.
*
* @param reportTO report to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created report
+ * @return Response object featuring Location header of created report
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
index bdf8411..7a3550b 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
@@ -103,7 +103,7 @@ public interface ResourceService extends JAXRSService {
* Creates a new resource.
*
* @param resourceTO Resource to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created resource
+ * @return Response object featuring Location header of created resource
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@@ -147,7 +147,7 @@ public interface ResourceService extends JAXRSService {
* @param anyTypeKey any object kind
* @param type resource de-association action type
* @param keys any object keys against which the bulk action will be performed
- * @return <tt>Response</tt> object featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>
+ * @return Response object featuring BulkActionResult as Entity
*/
@POST
@Path("{key}/bulkDeassociation/{anyTypeKey}/{action}")
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java
index 36f18e7..45628c7 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java
@@ -62,7 +62,7 @@ public interface RoleService extends JAXRSService {
* Creates a new role.
*
* @param roleTO role to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created role
+ * @return Response object featuring Location header of created role
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
index e59d7d0..4555bd9 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
@@ -67,26 +67,24 @@ public interface SchemaService extends JAXRSService {
/**
* Creates a new schema.
*
- * @param <T> actual SchemaTO
* @param type type for schema to be created
* @param schemaTO schema to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created schema
+ * @return Response object featuring Location header of created schema
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractSchemaTO> Response create(@NotNull @PathParam("type") SchemaType type, @NotNull T schemaTO);
+ Response create(@NotNull @PathParam("type") SchemaType type, @NotNull AbstractSchemaTO schemaTO);
/**
* Updates the schema matching the given type and key.
*
- * @param <T> actual SchemaTO
* @param type type for schemas to be updated
* @param schemaTO updated schema to be stored
*/
@PUT
@Path("{key}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractSchemaTO> void update(@NotNull @PathParam("type") SchemaType type, @NotNull T schemaTO);
+ void update(@NotNull @PathParam("type") SchemaType type, @NotNull AbstractSchemaTO schemaTO);
/**
* Deletes the schema matching the given type and key.
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
index d0a63f7..8104679 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
@@ -62,7 +62,7 @@ public interface SecurityQuestionService extends JAXRSService {
* Creates a new security question.
*
* @param securityQuestionTO security question to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created security question
+ * @return Response object featuring Location header of created security question
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
index bb5a1a8..772c09e 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
@@ -24,6 +24,9 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.apache.syncope.common.lib.to.SyncopeTO;
+/**
+ * General info about this Apache Syncope deployment.
+ */
@Path("")
public interface SyncopeService extends JAXRSService {
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
index d8814d3..2029a53 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
@@ -92,12 +92,11 @@ public interface TaskService extends JAXRSService {
* Creates a new task.
*
* @param taskTO task to be created
- * @param <T> type of taskTO
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created task
+ * @return Response object featuring Location header of created task
*/
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends SchedTaskTO> Response create(@NotNull T taskTO);
+ Response create(@NotNull SchedTaskTO taskTO);
/**
* Updates the task matching the provided key.
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
index cd934be..745129f 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
@@ -55,8 +55,8 @@ public interface UserSelfService extends JAXRSService {
*
* @param userTO user to be created
* @param storePassword whether password shall be stored internally
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of self-registered user as well as the user
- * itself - <tt>UserTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring Location header of self-registered user as well as the user
+ * itself - UserTO as Entity
*/
@POST
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@@ -68,7 +68,7 @@ public interface UserSelfService extends JAXRSService {
* Self-updates user.
*
* @param patch modification to be applied to self
- * @return <tt>Response</tt> object featuring the updated user - <tt>UserTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring the updated user - UserTO as Entity
*/
@PATCH
@Path("{key}")
@@ -80,7 +80,7 @@ public interface UserSelfService extends JAXRSService {
* Self-updates user.
*
* @param user complete update
- * @return <tt>Response</tt> object featuring the updated user - <tt>UserTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring the updated user - UserTO as Entity
*/
@PUT
@Path("{key}")
@@ -91,7 +91,7 @@ public interface UserSelfService extends JAXRSService {
/**
* Self-deletes user.
*
- * @return <tt>Response</tt> object featuring the deleted user - <tt>UserTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring the deleted user - UserTO as Entity
*/
@DELETE
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@@ -102,7 +102,7 @@ public interface UserSelfService extends JAXRSService {
*
* @param password the password value to update
*
- * @return <tt>Response</tt> object featuring the updated user - <tt>UserTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring the updated user - UserTO as Entity
*/
@POST
@Path("changePassword")
@@ -111,7 +111,7 @@ public interface UserSelfService extends JAXRSService {
/**
* Provides answer for the security question configured for user matching the given username, if any.
- * If provided anwser matches the one stored for that user, a password reset token is internally generated,
+ * If provided answer matches the one stored for that user, a password reset token is internally generated,
* otherwise an error is returned.
*
* @param username username for which the security answer is provided
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
index 0f54ace..0368ef1 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
@@ -43,7 +43,7 @@ public interface UserService extends AnyService<UserTO, UserPatch> {
* Gives the username for the provided user key.
*
* @param key user key
- * @return <tt>Response</tt> object featuring HTTP header with username matching the given key
+ * @return Response object featuring HTTP header with username matching the given key
*/
@OPTIONS
@Path("{key}/username")
@@ -53,7 +53,7 @@ public interface UserService extends AnyService<UserTO, UserPatch> {
* Gives the user key for the provided username.
*
* @param username username
- * @return <tt>Response</tt> object featuring HTTP header with key matching the given username
+ * @return Response object featuring HTTP header with key matching the given username
*/
@OPTIONS
@Path("{username}/key")
@@ -64,8 +64,8 @@ public interface UserService extends AnyService<UserTO, UserPatch> {
*
* @param userTO user to be created
* @param storePassword whether password shall be stored internally
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created user as well as the user itself
- * enriched with propagation status information - <tt>UserTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring Location header of created user as well as the user itself
+ * enriched with propagation status information - UserTO as Entity
*/
@POST
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@@ -78,8 +78,8 @@ public interface UserService extends AnyService<UserTO, UserPatch> {
* Performs a status update on given.
*
* @param statusPatch status update details
- * @return <tt>Response</tt> object featuring the updated user enriched with propagation status information
- * - <tt>UserTO</tt> as <tt>Entity</tt>
+ * @return Response object featuring the updated user enriched with propagation status information
+ * - UserTO as Entity
*/
@POST
@Path("{key}/status")
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
index 68858c7..1a1370c 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
@@ -31,7 +31,7 @@ import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.rest.api.RESTHeaders;
/**
- * REST operations for workflow definition management.
+ * REST operations for workflow definition.
*/
@Path("workflows/{anyTypeKind}")
public interface WorkflowService extends JAXRSService {
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/pom.xml
----------------------------------------------------------------------
diff --git a/core/rest-cxf/pom.xml b/core/rest-cxf/pom.xml
index 2a1fcad..808c7dd 100644
--- a/core/rest-cxf/pom.xml
+++ b/core/rest-cxf/pom.xml
@@ -107,6 +107,11 @@ under the License.
</dependency>
<dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-jaxrs</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.syncope.core</groupId>
<artifactId>syncope-core-logic</artifactId>
<version>${project.version}</version>
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwagger2Feature.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwagger2Feature.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwagger2Feature.java
new file mode 100644
index 0000000..8f29f60
--- /dev/null
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwagger2Feature.java
@@ -0,0 +1,137 @@
+/*
+ * 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.cxf;
+
+import io.swagger.jaxrs.config.BeanConfig;
+import io.swagger.jaxrs.config.DefaultReaderConfig;
+import io.swagger.jaxrs.config.ReaderConfig;
+import io.swagger.jaxrs.listing.ApiListingResource;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.core.Context;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean;
+import org.apache.cxf.jaxrs.ext.MessageContext;
+import org.apache.cxf.jaxrs.model.ClassResourceInfo;
+import org.apache.cxf.jaxrs.model.wadl.DocumentationProvider;
+import org.apache.cxf.jaxrs.model.wadl.JavaDocProvider;
+import org.apache.cxf.jaxrs.provider.ServerProviderFactory;
+import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
+import org.apache.cxf.jaxrs.utils.InjectionUtils;
+
+public class SyncopeSwagger2Feature extends Swagger2Feature {
+
+ private boolean dynamicBasePath;
+
+ private boolean replaceTags;
+
+ private DocumentationProvider javadocProvider;
+
+ public void setDynamicBasePath(final boolean dynamicBasePath) {
+ this.dynamicBasePath = dynamicBasePath;
+ }
+
+ public void setReplaceTags(final boolean replaceTags) {
+ this.replaceTags = replaceTags;
+ }
+
+ public void setJavaDocPath(final String javaDocPath) throws Exception {
+ this.javadocProvider = new JavaDocProvider(BusFactory.getDefaultBus(), javaDocPath);
+ }
+
+ @Override
+ protected void addSwaggerResource(final Server server) {
+ List<ClassResourceInfo> cris = Collections.emptyList();
+ if (!runAsFilter) {
+ List<Object> serviceBeans = new ArrayList<>();
+ ApiListingResource apiListingResource = new ApiListingResource();
+ serviceBeans.add(apiListingResource);
+ JAXRSServiceFactoryBean sfb =
+ (JAXRSServiceFactoryBean) server.getEndpoint().get(JAXRSServiceFactoryBean.class.getName());
+ sfb.setResourceClassesFromBeans(serviceBeans);
+ cris = sfb.getClassResourceInfo();
+ for (ClassResourceInfo cri : cris) {
+ if (ApiListingResource.class == cri.getResourceClass()) {
+ InjectionUtils.injectContextProxiesAndApplication(cri, apiListingResource, null);
+ }
+ }
+ }
+ List<Object> providers = new ArrayList<>();
+ providers.add(new SyncopeSwaggerSerializers(dynamicBasePath, replaceTags, javadocProvider, cris));
+ providers.add(new ReaderConfigFilter());
+ ((ServerProviderFactory) server.getEndpoint().get(
+ ServerProviderFactory.class.getName())).setUserProviders(providers);
+
+ BeanConfig beanConfig = new BeanConfig();
+ beanConfig.setResourcePackage(getResourcePackage());
+ beanConfig.setVersion(getVersion());
+ beanConfig.setBasePath(getBasePath());
+ beanConfig.setHost(getHost());
+ beanConfig.setSchemes(getSchemes());
+ beanConfig.setTitle(getTitle());
+ beanConfig.setDescription(getDescription());
+ beanConfig.setContact(getContact());
+ beanConfig.setLicense(getLicense());
+ beanConfig.setLicenseUrl(getLicenseUrl());
+ beanConfig.setTermsOfServiceUrl(getTermsOfServiceUrl());
+ beanConfig.setScan(isScan());
+ beanConfig.setPrettyPrint(isPrettyPrint());
+ beanConfig.setFilterClass(getFilterClass());
+ }
+
+ private class ReaderConfigFilter implements ContainerRequestFilter {
+
+ @Context
+ private MessageContext mc;
+
+ @Override
+ public void filter(final ContainerRequestContext requestContext) throws IOException {
+ if (mc.getServletContext().getAttribute(ReaderConfig.class.getName()) == null) {
+ if (mc.getServletConfig() != null
+ && Boolean.valueOf(mc.getServletConfig().getInitParameter("scan.all.resources"))) {
+
+ addReaderConfig(mc.getServletConfig().getInitParameter("ignore.routes"));
+ } else if (isScanAllResources()) {
+ addReaderConfig(getIgnoreRoutes());
+ }
+ }
+ }
+
+ private void addReaderConfig(final String ignoreRoutesParam) {
+ DefaultReaderConfig rc = new DefaultReaderConfig();
+ rc.setScanAllResources(true);
+ if (ignoreRoutesParam != null) {
+ Set<String> routes = new LinkedHashSet<>();
+ for (String route : StringUtils.split(ignoreRoutesParam, ",")) {
+ routes.add(route.trim());
+ }
+ rc.setIgnoredRoutes(routes);
+ }
+ mc.getServletContext().setAttribute(ReaderConfig.class.getName(), rc);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwaggerSerializers.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwaggerSerializers.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwaggerSerializers.java
new file mode 100644
index 0000000..5596c2a
--- /dev/null
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwaggerSerializers.java
@@ -0,0 +1,153 @@
+/*
+ * 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.cxf;
+
+import io.swagger.jaxrs.listing.SwaggerSerializers;
+import io.swagger.models.HttpMethod;
+import io.swagger.models.Operation;
+import io.swagger.models.Path;
+import io.swagger.models.Swagger;
+import io.swagger.models.Tag;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.cxf.jaxrs.ext.MessageContext;
+import org.apache.cxf.jaxrs.model.ClassResourceInfo;
+import org.apache.cxf.jaxrs.model.OperationResourceInfo;
+import org.apache.cxf.jaxrs.model.wadl.DocumentationProvider;
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
+
+public class SyncopeSwaggerSerializers extends SwaggerSerializers {
+
+ private final boolean dynamicBasePath;
+
+ private final boolean replaceTags;
+
+ private final DocumentationProvider javadocProvider;
+
+ private final List<ClassResourceInfo> cris;
+
+ public SyncopeSwaggerSerializers(
+ final boolean dynamicBasePath,
+ final boolean replaceTags,
+ final DocumentationProvider javadocProvider,
+ final List<ClassResourceInfo> cris) {
+
+ super();
+
+ this.dynamicBasePath = dynamicBasePath;
+ this.replaceTags = replaceTags;
+ this.javadocProvider = javadocProvider;
+ this.cris = cris;
+ }
+
+ @Override
+ public void writeTo(
+ final Swagger data,
+ final Class<?> type,
+ final Type genericType,
+ final Annotation[] annotations,
+ final MediaType mediaType,
+ final MultivaluedMap<String, Object> headers,
+ final OutputStream out) throws IOException {
+
+ if (dynamicBasePath) {
+ MessageContext ctx = JAXRSUtils.createContextValue(
+ JAXRSUtils.getCurrentMessage(), null, MessageContext.class);
+ data.setBasePath(StringUtils.substringBeforeLast(ctx.getHttpServletRequest().getRequestURI(), "/"));
+ }
+
+ if (replaceTags || javadocProvider != null) {
+ Map<String, ClassResourceInfo> operations = new HashMap<>();
+ Map<Pair<String, String>, OperationResourceInfo> methods = new HashMap<>();
+ for (ClassResourceInfo cri : cris) {
+ for (OperationResourceInfo ori : cri.getMethodDispatcher().getOperationResourceInfos()) {
+ StringBuilder fullPath = new StringBuilder().
+ append(cri.getURITemplate().getValue()).
+ append(ori.getURITemplate().getValue());
+ if (fullPath.charAt(fullPath.length() - 1) == '/') {
+ fullPath.setLength(fullPath.length() - 1);
+ }
+ // Adapt to Swagger's path expression
+ if (fullPath.toString().endsWith(":.*}")) {
+ fullPath.setLength(fullPath.length() - 4);
+ fullPath.append('}');
+ }
+
+ operations.put(fullPath.toString(), cri);
+ methods.put(ImmutablePair.of(ori.getHttpMethod(), fullPath.toString()), ori);
+ }
+ }
+
+ if (replaceTags && data.getTags() != null) {
+ data.getTags().clear();
+ }
+ for (final Map.Entry<String, Path> entry : data.getPaths().entrySet()) {
+ Tag tag = null;
+ if (replaceTags && operations.containsKey(entry.getKey())) {
+ ClassResourceInfo cri = operations.get(entry.getKey());
+
+ tag = new Tag();
+ tag.setName(cri.getURITemplate().getValue());
+ if (javadocProvider != null) {
+ tag.setDescription(javadocProvider.getClassDoc(cri));
+ }
+
+ data.addTag(tag);
+ }
+
+ for (Map.Entry<HttpMethod, Operation> subentry : entry.getValue().getOperationMap().entrySet()) {
+ if (replaceTags && tag != null) {
+ subentry.getValue().setTags(Collections.singletonList(tag.getName()));
+ }
+
+ Pair<String, String> key = ImmutablePair.of(subentry.getKey().name(), entry.getKey());
+ if (methods.containsKey(key) && javadocProvider != null) {
+ OperationResourceInfo ori = methods.get(key);
+
+ subentry.getValue().setSummary(javadocProvider.getMethodDoc(ori));
+ for (int i = 0; i < subentry.getValue().getParameters().size(); i++) {
+ subentry.getValue().getParameters().get(i).
+ setDescription(javadocProvider.getMethodParameterDoc(ori, i));
+ }
+
+ if (subentry.getValue().getResponses() != null
+ && !subentry.getValue().getResponses().isEmpty()) {
+
+ subentry.getValue().getResponses().entrySet().iterator().next().getValue().
+ setDescription(javadocProvider.getMethodResponseDoc(ori));
+ }
+ }
+ }
+ }
+ }
+
+ super.writeTo(data, type, genericType, annotations, mediaType, headers, out);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/WADLServlet.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/WADLServlet.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/WADLServlet.java
index e05012a..534ae9f 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/WADLServlet.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/WADLServlet.java
@@ -19,6 +19,8 @@
package org.apache.syncope.core.rest.cxf;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URL;
import java.rmi.ServerException;
import java.util.HashMap;
@@ -29,12 +31,15 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.MediaType;
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;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
public class WADLServlet extends HttpServlet {
@@ -42,6 +47,18 @@ public class WADLServlet extends HttpServlet {
private static final Pattern SCHEMA_PATTERN = Pattern.compile("/schema_(.*)_(.*)\\.html");
+ protected void finish(final Pipeline<SAXPipelineComponent> pipeline, final HttpServletResponse response)
+ throws ServletException, IOException {
+
+ pipeline.addComponent(XMLSerializer.createHTML4Serializer());
+ pipeline.setup(response.getOutputStream());
+ try {
+ pipeline.execute();
+ } catch (Exception e) {
+ throw new ServletException(e);
+ }
+ }
+
/**
* Handles the HTTP <code>GET</code> method.
*
@@ -54,15 +71,13 @@ public class WADLServlet extends HttpServlet {
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);
+ Matcher schemaMatcher = SCHEMA_PATTERN.matcher(request.getServletPath());
Pipeline<SAXPipelineComponent> pipeline = new CachingPipeline<>();
- final String wadlURL = request.getRequestURL().
- substring(0, request.getRequestURL().indexOf("/doc")) + "/?_wadl";
+ String wadlURL = StringUtils.substringBeforeLast(request.getRequestURL().toString(), "/")
+ + "/rest/?_wadl";
pipeline.addComponent(new XMLGenerator(new URL(wadlURL)));
- if ("/".equals(requestURI)) {
+ if ("/index.html".equals(request.getServletPath())) {
XSLTTransformer xslt = new XSLTTransformer(getClass().getResource("/wadl2html/index.xsl"));
Map<String, Object> parameters = new HashMap<>();
@@ -70,6 +85,8 @@ public class WADLServlet extends HttpServlet {
xslt.setParameters(parameters);
pipeline.addComponent(xslt);
+
+ finish(pipeline, response);
} else if (schemaMatcher.matches()) {
XSLTTransformer xslt = new XSLTTransformer(getClass().getResource("/wadl2html/schema.xsl"));
@@ -80,17 +97,22 @@ public class WADLServlet extends HttpServlet {
xslt.setParameters(parameters);
pipeline.addComponent(xslt);
+
+ finish(pipeline, response);
+ } else if ("/syncope.wadl".equals(request.getServletPath())) {
+ response.setContentType(MediaType.APPLICATION_XML);
+
+ InputStream in = new URL(wadlURL).openStream();
+ OutputStream out = response.getOutputStream();
+ try {
+ IOUtils.copy(in, out);
+ } finally {
+ IOUtils.closeQuietly(in);
+ IOUtils.closeQuietly(out);
+ }
} 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);
- }
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
index a6c4c5d..5e81978 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
@@ -39,8 +39,8 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
private PolicyLogic logic;
@Override
- public <T extends AbstractPolicyTO> Response create(final T policyTO) {
- T policy = logic.create(policyTO);
+ public Response create(final AbstractPolicyTO policyTO) {
+ AbstractPolicyTO policy = logic.create(policyTO);
URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(policy.getKey())).build();
return Response.created(location).
header(RESTHeaders.RESOURCE_KEY, policy.getKey()).
@@ -63,7 +63,7 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
}
@Override
- public <T extends AbstractPolicyTO> void update(final T policyTO) {
+ public void update(final AbstractPolicyTO policyTO) {
switch (policyTO.getType()) {
case ACCOUNT:
logic.update((AccountPolicyTO) policyTO);
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
index e846a95..d5380ab 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
@@ -36,8 +36,8 @@ public class SchemaServiceImpl extends AbstractServiceImpl implements SchemaServ
private SchemaLogic logic;
@Override
- public <T extends AbstractSchemaTO> Response create(final SchemaType schemaType, final T schemaTO) {
- T created = logic.create(schemaType, schemaTO);
+ public Response create(final SchemaType schemaType, final AbstractSchemaTO schemaTO) {
+ AbstractSchemaTO created = logic.create(schemaType, schemaTO);
URI location = uriInfo.getAbsolutePathBuilder().path(created.getKey()).build();
return Response.created(location).
@@ -61,7 +61,7 @@ public class SchemaServiceImpl extends AbstractServiceImpl implements SchemaServ
}
@Override
- public <T extends AbstractSchemaTO> void update(final SchemaType schemaType, final T schemaTO) {
+ public void update(final SchemaType schemaType, final AbstractSchemaTO schemaTO) {
logic.update(schemaType, schemaTO);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
index 5da1042..2f9de23 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
@@ -47,8 +47,8 @@ public class TaskServiceImpl extends AbstractServiceImpl implements TaskService
private TaskLogic logic;
@Override
- public <T extends SchedTaskTO> Response create(final T taskTO) {
- T createdTask;
+ public Response create(final SchedTaskTO taskTO) {
+ SchedTaskTO createdTask;
if (taskTO instanceof SyncTaskTO || taskTO instanceof PushTaskTO || taskTO instanceof SchedTaskTO) {
createdTask = logic.createSchedTask(taskTO);
} else {
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/src/main/resources/META-INF/web-fragment.xml
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/resources/META-INF/web-fragment.xml b/core/rest-cxf/src/main/resources/META-INF/web-fragment.xml
index a8a6e1f..ee51488 100644
--- a/core/rest-cxf/src/main/resources/META-INF/web-fragment.xml
+++ b/core/rest-cxf/src/main/resources/META-INF/web-fragment.xml
@@ -54,7 +54,9 @@ under the License.
</servlet>
<servlet-mapping>
<servlet-name>WADLServlet</servlet-name>
- <url-pattern>/rest/doc/*</url-pattern>
+ <url-pattern>/index.html</url-pattern>
+ <url-pattern>/schema_1_syncope1.html</url-pattern>
+ <url-pattern>/syncope.wadl</url-pattern>
</servlet-mapping>
<filter>
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/src/main/resources/restCXFContext.xml
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/resources/restCXFContext.xml b/core/rest-cxf/src/main/resources/restCXFContext.xml
index 2f6e70b..b12c9d4 100644
--- a/core/rest-cxf/src/main/resources/restCXFContext.xml
+++ b/core/rest-cxf/src/main/resources/restCXFContext.xml
@@ -77,7 +77,7 @@ under the License.
</bean>
<bean id="searchContextProvider" class="org.apache.cxf.jaxrs.ext.search.SearchContextProvider"/>
-
+
<bean id="addDomainFilter" class="org.apache.syncope.core.rest.cxf.AddDomainFilter"/>
<bean id="addETagFilter" class="org.apache.syncope.core.rest.cxf.AddETagFilter"/>
@@ -92,6 +92,20 @@ under the License.
<property name="javaDocPath" value="/WEB-INF/lib/syncope-common-rest-api-${syncope.version}-javadoc.jar"/>
</bean>
+ <bean id="swagger2Feature" class="org.apache.syncope.core.rest.cxf.SyncopeSwagger2Feature">
+ <property name="title" value="Apache Syncope"/>
+ <property name="version" value="${syncope.version}"/>
+ <property name="description" value="Apache Syncope ${syncope.version}"/>
+ <property name="contact" value="dev@syncope.apache.org"/>
+
+ <property name="resourcePackage" value="org.apache.syncope.common.rest.api.service"/>
+ <property name="scanAllResources" value="true"/>
+
+ <property name="dynamicBasePath" value="true"/>
+ <property name="replaceTags" value="true"/>
+ <property name="javaDocPath" value="/WEB-INF/lib/syncope-common-rest-api-${syncope.version}-javadoc.jar"/>
+ </bean>
+
<jaxrs:server id="restContainer" address="/"
basePackages="org.apache.syncope.common.rest.api.service, org.apache.syncope.core.rest.cxf.service"
staticSubresourceResolution="true">
@@ -114,6 +128,9 @@ under the License.
<ref bean="addETagFilter"/>
<ref bean="wadlGenerator"/>
</jaxrs:providers>
+ <jaxrs:features>
+ <ref bean="swagger2Feature"/>
+ </jaxrs:features>
<jaxrs:extensionMappings>
<entry key="json" value="application/json;charset=UTF-8"/>
<entry key="xml" value="application/xml;charset=UTF-8"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/core/rest-cxf/src/main/resources/wadl2html/index.xsl
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/resources/wadl2html/index.xsl b/core/rest-cxf/src/main/resources/wadl2html/index.xsl
index 9e37e24..b0012f4 100644
--- a/core/rest-cxf/src/main/resources/wadl2html/index.xsl
+++ b/core/rest-cxf/src/main/resources/wadl2html/index.xsl
@@ -113,12 +113,12 @@
});
</xsl:text>
- <xsl:variable name="parentResourcePath" select="translate(@path, '/{}:.*', '______')"/>
+ <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:variable name="childResourcePath" select="translate(@path, '|/{}:.*', '_______')"/>
<xsl:call-template name="dialog-init">
<xsl:with-param name="resourcePath" select="concat($parentResourcePath, $childResourcePath)"/>
</xsl:call-template>
@@ -253,7 +253,7 @@
<xsl:template name="methods">
<xsl:param name="resourcePath"/>
- <xsl:variable name="escapedPath" select="translate($resourcePath, '/{}:.*', '______')"/>
+ <xsl:variable name="escapedPath" select="translate($resourcePath, '|/{}:.*', '_______')"/>
<div class="methods">
<xsl:for-each select="wadl:method">
<button id="opener{$escapedPath}_{position()}">
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRouteRestClient.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRouteRestClient.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRouteRestClient.java
index a4e3a5d..8c6e6a5 100644
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRouteRestClient.java
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRouteRestClient.java
@@ -41,7 +41,7 @@ public class CamelRouteRestClient extends BaseRestClient {
public void update(final String key, final String content) {
CamelRouteTO routeTO = read(key);
routeTO.setContent(content);
- getService(CamelRouteService.class).update(key, routeTO);
+ getService(CamelRouteService.class).update(routeTO);
}
public boolean isCamelEnabledFor(final AnyTypeKind anyTypeKind) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java
----------------------------------------------------------------------
diff --git a/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java b/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java
index 7148de1..620a656 100644
--- a/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java
+++ b/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java
@@ -18,6 +18,7 @@ package org.apache.syncope.common.lib.to;
* specific language governing permissions and limitations
* under the License.
*/
+import javax.ws.rs.PathParam;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.apache.syncope.common.lib.AbstractBaseBean;
@@ -39,6 +40,7 @@ public class CamelRouteTO extends AbstractBaseBean {
return name;
}
+ @PathParam("key")
public void setKey(final String key) {
this.name = key;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
index 5d844df..6d7fd50 100644
--- a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
+++ b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
@@ -32,23 +32,46 @@ import javax.ws.rs.core.MediaType;
import org.apache.syncope.common.lib.to.CamelRouteTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
+/**
+ * REST operations for Camel routes.
+ */
@Path("camelRoutes")
public interface CamelRouteService extends JAXRSService {
+ /**
+ * List all routes for the given any type kind.
+ *
+ * @param anyTypeKind any type kind
+ * @return all routes for the given any type kind
+ */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<CamelRouteTO> list(@NotNull @MatrixParam("anyTypeKind") AnyTypeKind anyTypeKind);
+ /**
+ * Read the route with the given key.
+ *
+ * @param key route key
+ * @return route with given key
+ */
@GET
@Path("{key}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
CamelRouteTO read(@NotNull @PathParam("key") String key);
+ /**
+ * Update the given route.
+ *
+ * @param route to be updated
+ */
@PUT
@Path("{key}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void update(@NotNull @PathParam("key") String key, @NotNull CamelRouteTO route);
+ void update(@NotNull CamelRouteTO route);
+ /**
+ * Restart the underlying Apache Camel context.
+ */
@POST
@Path("restartContext")
void restartContext();
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java b/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
index 6853e2b..2ca3f6a 100644
--- a/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
+++ b/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
@@ -43,8 +43,7 @@ public class CamelRouteServiceImpl extends AbstractServiceImpl implements CamelR
}
@Override
- public void update(final String key, final CamelRouteTO route) {
- route.setKey(key);
+ public void update(final CamelRouteTO route) {
logic.update(route);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/ext/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pom.xml b/ext/pom.xml
index d4423ce..963caf9 100644
--- a/ext/pom.xml
+++ b/ext/pom.xml
@@ -58,6 +58,7 @@ under the License.
<modules>
<module>camel</module>
+ <module>swagger-ui</module>
</modules>
</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/ext/swagger-ui/pom.xml
----------------------------------------------------------------------
diff --git a/ext/swagger-ui/pom.xml b/ext/swagger-ui/pom.xml
new file mode 100644
index 0000000..0b6299b
--- /dev/null
+++ b/ext/swagger-ui/pom.xml
@@ -0,0 +1,107 @@
+<?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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.syncope</groupId>
+ <artifactId>syncope-ext</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Extensions: Swagger UI</name>
+ <description>Apache Syncope Extensions: Swagger UI</description>
+ <groupId>org.apache.syncope.ext</groupId>
+ <artifactId>syncope-ext-swagger-ui</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../..</rootpom.basedir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.webjars</groupId>
+ <artifactId>swagger-ui</artifactId>
+ <version>${swagger-ui.version}</version>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/swagger-ui</outputDirectory>
+ <excludes>**/*.gz</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/classes/META-INF/resources/swagger</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}</directory>
+ <excludes>
+ <exclude>index.html</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/ext/swagger-ui/src/main/resources/META-INF/resources/swagger/index.html
----------------------------------------------------------------------
diff --git a/ext/swagger-ui/src/main/resources/META-INF/resources/swagger/index.html b/ext/swagger-ui/src/main/resources/META-INF/resources/swagger/index.html
new file mode 100644
index 0000000..82e73bf
--- /dev/null
+++ b/ext/swagger-ui/src/main/resources/META-INF/resources/swagger/index.html
@@ -0,0 +1,163 @@
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <!-- <ApacheSyncope -->
+ <!--<title>Swagger UI</title>-->
+ <title>Swagger UI - Apache Syncope ${syncope.version}</title>
+ <!-- </ApacheSyncope -->
+ <link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
+ <link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
+ <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
+ <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
+ <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
+ <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
+ <script src='lib/underscore-min.js' type='text/javascript'></script>
+ <script src='lib/backbone-min.js' type='text/javascript'></script>
+ <script src='swagger-ui.js' type='text/javascript'></script>
+ <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
+ <script src='lib/marked.js' type='text/javascript'></script>
+ <script src='lib/swagger-oauth.js' type='text/javascript'></script>
+
+ <!-- Some basic translations -->
+ <!-- <script src='lang/translator.js' type='text/javascript'></script> -->
+ <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
+ <!-- <script src='lang/en.js' type='text/javascript'></script> -->
+
+ <script type="text/javascript">
+ $(function () {
+ // <ApacheSyncope>
+ /*var url = window.location.search.match(/url=([^&]+)/);
+ if (url && url.length > 1) {
+ url = decodeURIComponent(url[1]);
+ } else {
+ url = "http://petstore.swagger.io/v2/swagger.json";
+ }*/
+ var url = window.location.href.substring(0, window.location.href.lastIndexOf('/')) + "/../rest/swagger.json";
+ // </ApacheSyncope>
+
+ // Pre load translate...
+ if (window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate();
+ }
+ window.swaggerUi = new SwaggerUi({
+ url: url,
+ dom_id: "swagger-ui-container",
+ supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
+ onComplete: function (swaggerApi, swaggerUi) {
+ if (typeof initOAuth == "function") {
+ initOAuth({
+ clientId: "your-client-id",
+ clientSecret: "your-client-secret",
+ realm: "your-realms",
+ appName: "your-app-name",
+ scopeSeparator: ","
+ });
+ }
+
+ if (window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate();
+ }
+
+ $('pre code').each(function (i, e) {
+ hljs.highlightBlock(e)
+ });
+
+ addApiKeyAuthorization();
+ },
+ onFailure: function (data) {
+ log("Unable to Load SwaggerUI");
+ },
+ docExpansion: "none",
+ apisSorter: "alpha",
+ showRequestHeaders: false
+ });
+
+ function addApiKeyAuthorization() {
+ // <ApacheSyncope>
+ /*var key = encodeURIComponent($('#input_apiKey')[0].value);
+ if (key && key.trim() != "") {
+ var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
+ window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
+ log("added key " + key);
+ }*/
+ var username = $('#input_username').val().trim();
+ var password = $('#input_password').val().trim();
+ if (username !== "" && password !== "") {
+ window.swaggerUi.api.clientAuthorizations.add(
+ "basicAuth", new SwaggerClient.PasswordAuthorization(username, password));
+ }
+ // </ApacheSyncope>
+ }
+
+ // <ApacheSyncope>
+ //$('#input_apiKey').change(addApiKeyAuthorization);
+ $("#input_username").blur(function () {
+ addApiKeyAuthorization();
+ });
+ $("#input_password").blur(function () {
+ addApiKeyAuthorization();
+ });
+ // </ApacheSyncope>
+
+ // if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
+ /*
+ var apiKey = "myApiKeyXXXX123456789";
+ $('#input_apiKey').val(apiKey);
+ */
+
+ window.swaggerUi.load();
+
+ function log() {
+ if ('console' in window) {
+ console.log.apply(console, arguments);
+ }
+ }
+ });
+ </script>
+ </head>
+
+ <body class="swagger-section">
+ <div id='header'>
+ <div class="swagger-ui-wrap">
+ <a id="logo" href="http://swagger.io">swagger</a>
+ <form id='api_selector'>
+ <!-- <ApacheSyncope -->
+ <!--<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>-->
+ <!--<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>-->
+ <!--<div class='input'><a id="explore" href="#" data-sw-translate>Explore</a></div>-->
+ <div class='input'><input placeholder="username" id="input_username" name="username" type="text"/></div>
+ <div class='input'><input placeholder="password" id="input_password" name="password" type="password"/></div>
+ <!-- </ApacheSyncope -->
+ </form>
+ </div>
+ </div>
+
+ <div id="message-bar" class="swagger-ui-wrap" data-sw-translate> </div>
+ <div id="swagger-ui-container" class="swagger-ui-wrap"></div>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/5934d54f/fit/console-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/console-reference/pom.xml b/fit/console-reference/pom.xml
index c2785ac..7227f04 100644
--- a/fit/console-reference/pom.xml
+++ b/fit/console-reference/pom.xml
@@ -435,10 +435,6 @@ ORYX.Editor.createByUrl = function(modelUrl){"/>
<profile>
<id>jrebel</id>
- <properties>
- <javaagent>-javaagent:${env.REBEL_HOME}/jrebel.jar</javaagent>
- </properties>
-
<build>
<defaultGoal>clean verify cargo:run</defaultGoal>
@@ -451,7 +447,69 @@ ORYX.Editor.createByUrl = function(modelUrl){"/>
<classpath>
<fallback>default</fallback>
<resources>
- <resource/>
+ <resource>
+ <directory>${basedir}/../../common/lib/target/classes</directory>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../common/rest-api/target/classes</directory>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/logic/target/classes</directory>
+ <excludes>
+ <exclude>*Context.xml</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/rest-cxf/target/classes</directory>
+ <excludes>
+ <exclude>*Context.xml</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/misc/target/classes</directory>
+ <excludes>
+ <exclude>*Context.xml</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/persistence-api/target/classes</directory>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/persistence-jpa/target/classes</directory>
+ <excludes>
+ <exclude>*Context.xml</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/provisioning-api/target/classes</directory>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/provisioning-java/target/classes</directory>
+ <excludes>
+ <exclude>*Context.xml</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/workflow-api/target/classes</directory>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/workflow-java/target/classes</directory>
+ <excludes>
+ <exclude>*Context.xml</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../core/workflow-activiti/target/classes</directory>
+ <excludes>
+ <exclude>*Context.xml</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../ext/camel/provisioning-camel/target/classes</directory>
+ <excludes>
+ <exclude>*Context.xml</exclude>
+ </excludes>
+ </resource>
<resource>
<directory>${basedir}/../../client/console/target/classes</directory>
</resource>
@@ -463,7 +521,6 @@ ORYX.Editor.createByUrl = function(modelUrl){"/>
<web>
<resources>
- <resource/>
<resource>
<target>/</target>
<directory>${basedir}/../../client/console/target/classes/META-INF/resources/</directory>
@@ -496,8 +553,8 @@ ORYX.Editor.createByUrl = function(modelUrl){"/>
<configuration>
<properties>
<cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
- -noverify ${javaagent} -Drebel.spring_plugin=true
- -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m</cargo.jvmargs>
+ -noverify -javaagent:${env.REBEL_HOME}/jrebel.jar -Drebel.spring_plugin=true
+ -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs>
</properties>
</configuration>
</configuration>