Finally fixing WADL offline generation and live browsing
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/926e8fd9 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/926e8fd9 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/926e8fd9 Branch: refs/heads/master Commit: 926e8fd90201be8fa31f8c518c73423ae06669e2 Parents: 64c5fbd Author: Francesco Chicchiriccò <[email protected]> Authored: Thu Aug 27 15:45:13 2015 +0200 Committer: Francesco Chicchiriccò <[email protected]> Committed: Thu Aug 27 15:45:13 2015 +0200 ---------------------------------------------------------------------- .../syncope/common/lib/policy/package-info.java | 23 ++++ common/rest-api/pom.xml | 43 +++--- .../common/rest/api/service/AnyService.java | 38 +----- .../rest/api/service/AnyTypeClassService.java | 7 - .../common/rest/api/service/AnyTypeService.java | 7 - .../rest/api/service/ConnectorService.java | 7 - .../common/rest/api/service/DomainService.java | 7 - .../common/rest/api/service/GroupService.java | 10 +- .../rest/api/service/NotificationService.java | 7 - .../common/rest/api/service/PolicyService.java | 6 - .../common/rest/api/service/RealmService.java | 7 - .../api/service/RelationshipTypeService.java | 7 - .../common/rest/api/service/ReportService.java | 6 - .../rest/api/service/ResourceService.java | 13 +- .../common/rest/api/service/RoleService.java | 7 - .../common/rest/api/service/SchemaService.java | 6 - .../api/service/SecurityQuestionService.java | 7 - .../common/rest/api/service/SyncopeService.java | 5 + .../common/rest/api/service/TaskService.java | 6 - .../rest/api/service/UserSelfService.java | 22 +-- .../common/rest/api/service/UserService.java | 25 +--- core/rest-cxf/pom.xml | 135 ++++++++++++++++++- .../syncope/core/rest/cxf/WADLServlet.java | 96 ------------- .../main/resources/META-INF/web-fragment.xml | 9 -- .../src/main/resources/restCXFContext.xml | 15 +-- .../src/main/resources/wadl2html/identity.xsl | 28 ++++ .../src/main/resources/wadl2html/index.xsl | 7 +- pom.xml | 11 +- 28 files changed, 238 insertions(+), 329 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/common/lib/src/main/java/org/apache/syncope/common/lib/policy/package-info.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/package-info.java b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/package-info.java new file mode 100644 index 0000000..bb26628 --- /dev/null +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/package-info.java @@ -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.lib.policy; + +import javax.xml.bind.annotation.XmlSchema; +import org.apache.syncope.common.lib.SyncopeConstants; http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/common/rest-api/pom.xml ---------------------------------------------------------------------- diff --git a/common/rest-api/pom.xml b/common/rest-api/pom.xml index 16f93e3..7a01834 100644 --- a/common/rest-api/pom.xml +++ b/common/rest-api/pom.xml @@ -47,18 +47,6 @@ 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.cxf</groupId> - <artifactId>cxf-rt-rs-extension-search</artifactId> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-rs-service-description</artifactId> - </dependency> <dependency> <groupId>org.apache.syncope.common</groupId> @@ -69,17 +57,38 @@ under the License. <build> <plugins> - <!-- Generating javadoc JAR artifact for usage with CXF's WADL generator (for core) --> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-java2wadl-plugin</artifactId> <inherited>true</inherited> <executions> <execution> - <id>attach-javadocs</id> + <id>parsejavadoc</id> + <phase>process-classes</phase> + <goals> + <goal>parsejavadoc</goal> + </goals> + </execution> + <execution> + <id>process-classes</id> + <phase>process-classes</phase> <goals> - <goal>jar</goal> + <goal>java2wadl</goal> </goals> + <configuration> + <applicationTitle>Apache Syncope ${project.version}</applicationTitle> + <namespacePrefix>syncope</namespacePrefix> + <linkAnyMediaTypeToXmlSchema>true</linkAnyMediaTypeToXmlSchema> + <useJaxbContextForQnames>true</useJaxbContextForQnames> + <ignoreMessageWriters>true</ignoreMessageWriters> + <addResourceAndMethodIds>true</addResourceAndMethodIds> + <usePathParamsToCompareOperations>false</usePathParamsToCompareOperations> + <singleResourceMultipleMethods>true</singleResourceMultipleMethods> + <classResourceNames /> + <basePackages>org.apache.syncope.common.rest.api.service</basePackages> + <docProvider>org.apache.cxf.maven_plugin.javatowadl.ResourceMapJavaDocProvider</docProvider> + <attachWadl>true</attachWadl> + </configuration> </execution> </executions> </plugin> http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 1c0fda2..71aa4b6 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.mod.AnyMod; import org.apache.syncope.common.lib.mod.ResourceAssociationMod; import org.apache.syncope.common.lib.to.AnyTO; @@ -84,14 +81,8 @@ public interface AnyService<TO extends AnyTO, MOD extends AnyMod> extends JAXRSS * * @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 - {@link AnyTO} as <tt>Entity</tt> + * object itself enriched with propagation status information - <tt>AnyTO</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "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>") - }) @POST @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @@ -102,13 +93,8 @@ public interface AnyService<TO extends AnyTO, MOD extends AnyMod> extends JAXRSS * * @param anyMod 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 - * - {@link AnyTO} as <tt>Entity</tt> + * - <tt>AnyTO</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring the updated any object enriched with propagation status information - " - + "<tt>AnyTO</tt> as <tt>Entity</tt>") - }) @POST @Path("{key}") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @@ -120,13 +106,8 @@ public interface AnyService<TO extends AnyTO, MOD extends AnyMod> extends JAXRSS * * @param key key of any object to be deleted * @return <tt>Response</tt> object featuring the deleted any object enriched with propagation status information - * - {@link AnyTO} as <tt>Entity</tt> + * - <tt>AnyTO</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring the deleted any object enriched with propagation status information - " - + "<tt>AnyTO</tt> as <tt>Entity</tt>") - }) @DELETE @Path("{key}") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @@ -139,13 +120,8 @@ public interface AnyService<TO extends AnyTO, MOD extends AnyMod> extends JAXRSS * @param key any object id. * @param type resource association action type * @param resourceNames external resources to be used for propagation-related operations - * @return <tt>Response</tt> object featuring - * {@link BulkActionResult} as <tt>Entity</tt> + * @return <tt>Response</tt> object featuring <tt>BulkActionResult</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>") - }) @POST @Path("{key}/deassociate/{type}") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @@ -161,12 +137,8 @@ public interface AnyService<TO extends AnyTO, MOD extends AnyMod> extends JAXRSS * @param key any object id. * @param type resource association action type * @param associationMod external resources to be used for propagation-related operations - * @return <tt>Response</tt> object featuring {@link BulkActionResult} as <tt>Entity</tt> + * @return <tt>Response</tt> object featuring <tt>BulkActionResult</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>") - }) @POST @Path("{key}/associate/{type}") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 43c3d23..454652e 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.AnyTypeClassTO; /** @@ -67,10 +64,6 @@ public interface AnyTypeClassService extends JAXRSService { * @param anyTypeClassTO anyTypeClass to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created anyTypeClass */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created anyTypeClass") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull AnyTypeClassTO anyTypeClassTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 c4a8c02..8f01fc1 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.AnyTypeTO; /** @@ -67,10 +64,6 @@ public interface AnyTypeService extends JAXRSService { * @param anyTypeTO anyType to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created anyType */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created anyType") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull AnyTypeTO anyTypeTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 66da67c..b523758 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 @@ -32,9 +32,6 @@ 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.lib.to.BulkAction; import org.apache.syncope.common.lib.to.BulkActionResult; import org.apache.syncope.common.lib.to.ConnBundleTO; @@ -148,10 +145,6 @@ public interface ConnectorService extends JAXRSService { * @param connInstanceTO connector instance to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created connector instance */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created connector instance") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull ConnInstanceTO connInstanceTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 4076dc1..a37c643 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.DomainTO; /** @@ -67,10 +64,6 @@ public interface DomainService extends JAXRSService { * @param domainTO domain to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created domain */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created domain") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull DomainTO domainTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 7d48b46..569c0b6 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 @@ -23,9 +23,6 @@ import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -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.lib.mod.GroupMod; import org.apache.syncope.common.lib.to.GroupTO; @@ -36,16 +33,11 @@ import org.apache.syncope.common.lib.to.GroupTO; public interface GroupService extends AnyService<GroupTO, GroupMod> { /** - * This method is similar to {@link #read(Long)}, but uses different authentication handling to ensure that a user + * This method is similar to <tt>read()</tt>, but uses different authentication handling to ensure that a user * can read his own groups. * * @return own groups */ - @Descriptions({ - @Description(target = DocTarget.METHOD, - value = "This method is similar to <tt>read()</tt>, but uses different authentication handling to " - + "ensure that a user can read his own groups.") - }) @GET @Path("own") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 ae33d5a..c380d31 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.NotificationTO; /** @@ -67,10 +64,6 @@ public interface NotificationService extends JAXRSService { * @param notificationTO Creates a new notification. * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created notification */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created notification") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull NotificationTO notificationTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 55b8747..e35ef7c 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 @@ -31,9 +31,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.policy.AbstractPolicyTO; import org.apache.syncope.common.lib.types.PolicyType; @@ -73,9 +70,6 @@ public interface PolicyService extends JAXRSService { * @param <T> response type (extending PolicyTO) * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created policy */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, value = "Featuring <tt>Location</tt> header of created policy") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) <T extends AbstractPolicyTO> Response create(@NotNull T policyTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 74b2333..81111e0 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.RealmTO; /** @@ -68,10 +65,6 @@ public interface RealmService extends JAXRSService { * @param realmTO new realm. * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created realm */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created realm") - }) @POST @Path("{parentPath:.*}") @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 178bb6c..30a7a15 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.RelationshipTypeTO; /** @@ -67,10 +64,6 @@ public interface RelationshipTypeService extends JAXRSService { * @param relationshipTypeTO relationshipType to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created relationshipType */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created relationshipType") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull RelationshipTypeTO relationshipTypeTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 44863ba..6d01b2a 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 @@ -33,9 +33,6 @@ 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.lib.to.PagedResult; import org.apache.syncope.common.lib.to.ReportExecTO; import org.apache.syncope.common.lib.to.ReportTO; @@ -88,9 +85,6 @@ public interface ReportService extends JAXRSService { * @param reportTO report to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created report */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, value = "Featuring <tt>Location</tt> header of created report") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull ReportTO reportTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 cac9132..f15bcd5 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.BulkAction; import org.apache.syncope.common.lib.to.BulkActionResult; import org.apache.syncope.common.lib.to.ConnObjectTO; @@ -87,10 +84,6 @@ public interface ResourceService extends JAXRSService { * @param resourceTO Resource to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created resource */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created resource") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull ResourceTO resourceTO); @@ -134,12 +127,8 @@ 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 {@link BulkActionResult} as <tt>Entity</tt> + * @return <tt>Response</tt> object featuring <tt>BulkActionResult</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>") - }) @POST @Path("{key}/bulkDeassociation/{anyTypeKey}/{type}") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 d6afa1f..36f18e7 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.RoleTO; /** @@ -67,10 +64,6 @@ public interface RoleService extends JAXRSService { * @param roleTO role to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created role */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created role") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull RoleTO roleTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 195e756..e59d7d0 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.AbstractSchemaTO; import org.apache.syncope.common.lib.types.SchemaType; @@ -75,9 +72,6 @@ public interface SchemaService extends JAXRSService { * @param schemaTO schema to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created schema */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, value = "Featuring <tt>Location</tt> 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); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 f0dcf27..d0a63f7 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 @@ -30,9 +30,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; 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.lib.to.SecurityQuestionTO; /** @@ -67,10 +64,6 @@ public interface SecurityQuestionService extends JAXRSService { * @param securityQuestionTO security question to be created * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created security question */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created security question") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response create(@NotNull SecurityQuestionTO securityQuestionTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 cdd6dbc..bb5a1a8 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 @@ -27,6 +27,11 @@ import org.apache.syncope.common.lib.to.SyncopeTO; @Path("") public interface SyncopeService extends JAXRSService { + /** + * Provides information summary about this Apache Syncope deployment's configuration. + * + * @return information summary about this Apache Syncope deployment's configuration + */ @GET @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) SyncopeTO info(); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 31b76f4..2665c51 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 @@ -34,9 +34,6 @@ 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.lib.to.AbstractTaskTO; import org.apache.syncope.common.lib.to.BulkAction; import org.apache.syncope.common.lib.to.BulkActionResult; @@ -99,9 +96,6 @@ public interface TaskService extends JAXRSService { * @param <T> type of taskTO * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created task */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, value = "Featuring <tt>Location</tt> header of created task") - }) @POST @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) <T extends SchedTaskTO> Response create(@NotNull T taskTO); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 dd2fe7e..2203a11 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 @@ -29,9 +29,6 @@ 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.lib.mod.UserMod; import org.apache.syncope.common.lib.to.UserTO; @@ -57,13 +54,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 - {@link UserTO} as <tt>Entity</tt> + * itself - <tt>UserTO</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of self-registered user as well " - + "as the user itself - {@link UserTO} as <tt>Entity</tt>") - }) @POST @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @@ -74,12 +66,8 @@ public interface UserSelfService extends JAXRSService { * Self-updates user. * * @param userMod modification to be applied to user matching the provided key - * @return <tt>Response</tt> object featuring the updated user - {@link UserTO} as <tt>Entity</tt> + * @return <tt>Response</tt> object featuring the updated user - <tt>UserTO</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring the updated user - <tt>UserTO</tt> as <tt>Entity</tt>") - }) @POST @Path("{key}") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @@ -89,12 +77,8 @@ public interface UserSelfService extends JAXRSService { /** * Self-deletes user. * - * @return <tt>Response</tt> object featuring the deleted user - {@link UserTO} as <tt>Entity</tt> + * @return <tt>Response</tt> object featuring the deleted user - <tt>UserTO</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring the deleted user - <tt>UserTO</tt> as <tt>Entity</tt>") - }) @DELETE @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) Response delete(); http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 418e233..fd0faac 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 @@ -29,9 +29,6 @@ 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.lib.mod.StatusMod; import org.apache.syncope.common.lib.mod.UserMod; import org.apache.syncope.common.lib.to.UserTO; @@ -48,10 +45,6 @@ public interface UserService extends AnyService<UserTO, UserMod> { * @param key user key * @return <tt>Response</tt> object featuring HTTP header with username matching the given key */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring HTTP header with username matching the given key") - }) @OPTIONS @Path("{key}/username") Response getUsername(@NotNull @PathParam("key") Long key); @@ -62,10 +55,6 @@ public interface UserService extends AnyService<UserTO, UserMod> { * @param username username * @return <tt>Response</tt> object featuring HTTP header with key matching the given username */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring HTTP header with key matching the given username") - }) @OPTIONS @Path("{username}/key") Response getUserKey(@NotNull @PathParam("username") String username); @@ -76,13 +65,8 @@ public interface UserService extends AnyService<UserTO, UserMod> { * @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 - {@link UserTO} as <tt>Entity</tt> + * enriched with propagation status information - <tt>UserTO</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "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>") - }) @POST @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @@ -95,13 +79,8 @@ public interface UserService extends AnyService<UserTO, UserMod> { * * @param statusMod status update details * @return <tt>Response</tt> object featuring the updated user enriched with propagation status information - * - {@link UserTO} as <tt>Entity</tt> + * - <tt>UserTO</tt> as <tt>Entity</tt> */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring the updated user enriched with propagation status information - " - + "<tt>UserTO</tt> as <tt>Entity</tt>") - }) @POST @Path("{key}/status") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/core/rest-cxf/pom.xml ---------------------------------------------------------------------- diff --git a/core/rest-cxf/pom.xml b/core/rest-cxf/pom.xml index 1651193..89c0de4 100644 --- a/core/rest-cxf/pom.xml +++ b/core/rest-cxf/pom.xml @@ -105,12 +105,6 @@ under the License. </dependency> <dependency> - <groupId>org.apache.syncope.common</groupId> - <artifactId>syncope-common-rest-api</artifactId> - <version>${project.version}</version> - <classifier>javadoc</classifier> - </dependency> - <dependency> <groupId>org.apache.syncope.core</groupId> <artifactId>syncope-core-logic</artifactId> <version>${project.version}</version> @@ -120,7 +114,7 @@ under the License. <artifactId>syncope-common-rest-api</artifactId> <version>${project.version}</version> </dependency> - + <dependency> <groupId>org.webjars</groupId> <artifactId>jquery</artifactId> @@ -131,6 +125,10 @@ under the License. </dependency> <dependency> <groupId>org.webjars</groupId> + <artifactId>jquery-ui-themes</artifactId> + </dependency> + <dependency> + <groupId>org.webjars</groupId> <artifactId>highlightjs</artifactId> </dependency> </dependencies> @@ -139,6 +137,129 @@ under the License. <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <inherited>false</inherited> + <configuration> + <outputDirectory>${project.build.directory}</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>org.apache.syncope.common</groupId> + <artifactId>syncope-common-rest-api</artifactId> + <version>${project.version}</version> + <type>wadl</type> + </artifactItem> + </artifactItems> + </configuration> + <executions> + <execution> + <phase>process-resources</phase> + <goals> + <goal>copy</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>xml-maven-plugin</artifactId> + <inherited>true</inherited> + <executions> + <execution> + <phase>prepare-package</phase> + <goals> + <goal>transform</goal> + </goals> + </execution> + </executions> + <configuration> + <transformationSets> + <transformationSet> + <dir>${project.build.directory}</dir> + <includes> + <include>syncope-common-rest-api-${project.version}.wadl</include> + </includes> + <outputDir>${project.build.directory}/classes/META-INF/resources/doc</outputDir> + <stylesheet>${project.build.directory}/classes/wadl2html/identity.xsl</stylesheet> + <outputProperties> + <outputProperty> + <name>indent</name> + <value>yes</value> + </outputProperty> + </outputProperties> + <fileMappers> + <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper"> + <pattern>^.*$</pattern> + <replacement>syncope.wadl</replacement> + </fileMapper> + </fileMappers> + </transformationSet> + <transformationSet> + <dir>${project.build.directory}</dir> + <includes> + <include>syncope-common-rest-api-${project.version}.wadl</include> + </includes> + <outputDir>${project.build.directory}/classes/META-INF/resources/doc</outputDir> + <stylesheet>${project.build.directory}/classes/wadl2html/index.xsl</stylesheet> + <parameters> + <parameter> + <name>contextPath</name> + <value>..</value> + </parameter> + </parameters> + <outputProperties> + <outputProperty> + <name>indent</name> + <value>yes</value> + </outputProperty> + </outputProperties> + <fileMappers> + <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper"> + <pattern>^.*$</pattern> + <replacement>index.html</replacement> + </fileMapper> + </fileMappers> + </transformationSet> + <transformationSet> + <dir>${project.build.directory}</dir> + <includes> + <include>syncope-common-rest-api-${project.version}.wadl</include> + </includes> + <outputDir>${project.build.directory}/classes/META-INF/resources/doc</outputDir> + <stylesheet>${project.build.directory}/classes/wadl2html/schema.xsl</stylesheet> + <parameters> + <parameter> + <name>contextPath</name> + <value>..</value> + </parameter> + <parameter> + <name>schema-position</name> + <value>1</value> + </parameter> + <parameter> + <name>schema-prefix</name> + <value>syncope1</value> + </parameter> + </parameters> + <outputProperties> + <outputProperty> + <name>indent</name> + <value>yes</value> + </outputProperty> + </outputProperties> + <fileMappers> + <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper"> + <pattern>^.*$</pattern> + <replacement>schema_1_syncope1.html</replacement> + </fileMapper> + </fileMappers> + </transformationSet> + </transformationSets> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> </plugin> </plugins> http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 deleted file mode 100644 index e5d5c74..0000000 --- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/WADLServlet.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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 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<>(); - 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<>(); - 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); - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 d5e53ef..e9ded9d 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 @@ -46,15 +46,6 @@ 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.cxf.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> http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 b26ed2e..b8f8948 100644 --- a/core/rest-cxf/src/main/resources/restCXFContext.xml +++ b/core/rest-cxf/src/main/resources/restCXFContext.xml @@ -78,23 +78,13 @@ under the License. <bean id="searchContextProvider" class="org.apache.cxf.jaxrs.ext.search.SearchContextProvider"/> - <bean id="wadlGenerator" class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator"> - <property name="applicationTitle" value="Apache Syncope ${syncope.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"/> - <property name="usePathParamsToCompareOperations" value="false"/> - <property name="javaDocPath" value="/WEB-INF/lib/syncope-common-rest-api-${syncope.version}-javadoc.jar"/> - </bean> - <bean id="addDomainFilter" class="org.apache.syncope.core.rest.cxf.AddDomainFilter"/> <bean id="addETagFilter" class="org.apache.syncope.core.rest.cxf.AddETagFilter"/> <jaxrs:server id="restContainer" address="/" basePackages="org.apache.syncope.common.rest.api.service, org.apache.syncope.core.rest.cxf.service" - staticSubresourceResolution="true"> + staticSubresourceResolution="true" + docLocation="classpath:/META-INF/resources/doc/syncope.wadl"> <jaxrs:properties> <entry key="search.lax.property.match" value="true"/> </jaxrs:properties> @@ -109,7 +99,6 @@ under the License. <ref bean="jsonProvider"/> <ref bean="exceptionMapper"/> <ref bean="searchContextProvider"/> - <ref bean="wadlGenerator"/> <ref bean="addDomainFilter"/> <ref bean="addETagFilter"/> </jaxrs:providers> http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/core/rest-cxf/src/main/resources/wadl2html/identity.xsl ---------------------------------------------------------------------- diff --git a/core/rest-cxf/src/main/resources/wadl2html/identity.xsl b/core/rest-cxf/src/main/resources/wadl2html/identity.xsl new file mode 100644 index 0000000..3678f80 --- /dev/null +++ b/core/rest-cxf/src/main/resources/wadl2html/identity.xsl @@ -0,0 +1,28 @@ +<?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" + version="1.0"> + + <xsl:template match="node()|@*"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> +</xsl:stylesheet> http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/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 a4809a7..9e37e24 100644 --- a/core/rest-cxf/src/main/resources/wadl2html/index.xsl +++ b/core/rest-cxf/src/main/resources/wadl2html/index.xsl @@ -46,7 +46,7 @@ <xsl:value-of select="wadl:doc/@title"/> </title> - <link rel="stylesheet" href="{$contextPath}/webjars/jquery-ui/${jquery-ui.version}/jquery-ui.min.css"/> + <link rel="stylesheet" href="{$contextPath}/webjars/jquery-ui-themes/${jquery-ui.version}/smoothness/jquery-ui.min.css"/> <style> body { font-family: "Verdana,Arial,sans-serif"; @@ -142,6 +142,7 @@ <th>Prefix</th> <th>URI</th> <th>XSD</th> + <th>WADL</th> </tr> <xsl:apply-templates select="wadl:grammars/xs:schema"/> </table> @@ -212,6 +213,10 @@ onClick="window.open('', 'schema', '', true).focus();" target="schema"> <xsl:value-of select="$prefix"/>.xsd</a> </td> + <td> + <a href="syncope.wadl" + onClick="window.open('', 'wadl', '', true).focus();" target="wadl">syncope.wadl</a> + </td> </tr> </xsl:template> http://git-wip-us.apache.org/repos/asf/syncope/blob/926e8fd9/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index adc785d..68e2997 100644 --- a/pom.xml +++ b/pom.xml @@ -326,7 +326,7 @@ under the License. <connid.ldap.version>1.4.0</connid.ldap.version> <connid.ad.version>1.2.3</connid.ad.version> - <cxf.version>3.1.2</cxf.version> + <cxf.version>3.1.3-SNAPSHOT</cxf.version> <camel.version>2.15.3</camel.version> @@ -371,7 +371,7 @@ under the License. <log.directory>${project.build.directory}/log</log.directory> <activiti-modeler.directory>${project.build.directory}/activiti-modeler</activiti-modeler.directory> - <jquery.version>2.1.3</jquery.version> + <jquery.version>2.1.4</jquery.version> <jquery-ui.version>1.11.4</jquery-ui.version> <jquery-cookie.version>1.4.1-1</jquery-cookie.version> <bootstrap.version>3.3.5</bootstrap.version> @@ -931,6 +931,11 @@ under the License. </dependency> <dependency> <groupId>org.webjars</groupId> + <artifactId>jquery-ui-themes</artifactId> + <version>${jquery-ui.version}</version> + </dependency> + <dependency> + <groupId>org.webjars</groupId> <artifactId>bootstrap</artifactId> <version>${bootstrap.version}</version> </dependency> @@ -1081,7 +1086,7 @@ under the License. <configuration> <source>${targetJdk}</source> <target>${targetJdk}</target> - <useIncrementalCompilation>false</useIncrementalCompilation> + <useIncrementalCompilation>false</useIncrementalCompilation> <showWarnings>true</showWarnings> <showDeprecation>true</showDeprecation> <!--<compilerArgument>-Xlint:unchecked</compilerArgument>-->
