Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E507B17E41 for ; Tue, 3 Feb 2015 12:35:48 +0000 (UTC) Received: (qmail 6826 invoked by uid 500); 3 Feb 2015 12:35:34 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 6761 invoked by uid 500); 3 Feb 2015 12:35:33 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 6752 invoked by uid 99); 3 Feb 2015 12:35:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 12:35:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 96BFFE01B7; Tue, 3 Feb 2015 12:35:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: Updating WADLGenerator to optionally avoid converting relative links to absolute ones in the external documents Date: Tue, 3 Feb 2015 12:35:33 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/master 2895b7b05 -> 71584641a Updating WADLGenerator to optionally avoid converting relative links to absolute ones in the external documents Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/71584641 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/71584641 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/71584641 Branch: refs/heads/master Commit: 71584641a21c7206f274aa5d6f227e18e4e77206 Parents: 2895b7b Author: Sergey Beryozkin Authored: Tue Feb 3 12:35:17 2015 +0000 Committer: Sergey Beryozkin Committed: Tue Feb 3 12:35:17 2015 +0000 ---------------------------------------------------------------------- .../java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/71584641/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java ---------------------------------------------------------------------- diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java index 6e2cab2..491c0c5 100644 --- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java +++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java @@ -156,6 +156,7 @@ public class WadlGenerator implements ContainerRequestFilter { private boolean supportJaxbSubstitutions = true; private boolean ignoreOverloadedMethods; private boolean checkAbsolutePathSlash; + private boolean keepRelativeDocLinks; private List externalSchemasCache; private List externalSchemaLinks; @@ -1169,6 +1170,9 @@ public class WadlGenerator implements ContainerRequestFilter { private void handleExistingDocRefs(List elements, String attrName, String parentDocLoc, String parentRef, Message m, UriInfo ui) { + if (keepRelativeDocLinks) { + return; + } int index = parentDocLoc.lastIndexOf('/'); parentDocLoc = index == -1 ? parentDocLoc : parentDocLoc.substring(0, index + 1); @@ -2041,6 +2045,10 @@ public class WadlGenerator implements ContainerRequestFilter { this.ignoreOverloadedMethods = ignore; } + public void setKeepRelativeDocLinks(boolean keepRelativeDocLinks) { + this.keepRelativeDocLinks = keepRelativeDocLinks; + } + private static class SchemaConverter extends DelegatingXMLStreamWriter { private static final String SCHEMA_LOCATION = "schemaLocation"; private Map locsMap;