cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1372396 - in /cxf/branches/2.6.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Date Mon, 13 Aug 2012 12:30:26 GMT
Author: sergeyb
Date: Mon Aug 13 12:30:26 2012
New Revision: 1372396

URL: http://svn.apache.org/viewvc?rev=1372396&view=rev
Log:
Merged revisions 1372389 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1372389 | sergeyb | 2012-08-13 15:24:46 +0300 (Mon, 13 Aug 2012) | 1 line
  
  Making sure publishedEndpointUrl is used when calculating schema refs
........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1372389

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=1372396&r1=1372395&r2=1372396&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Mon Aug 13 12:30:26 2012
@@ -51,6 +51,7 @@ import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -860,7 +861,7 @@ public class WadlGenerator implements Re
                                                                                 "grammars");
                         if (grammarEls.size() == 1) {
                             handleSchemaRefs(DOMUtils.getChildrenWithName(grammarEls.get(0),

-                                WadlGenerator.WADL_NS, "include"), "href", loc, "", ui);
+                                WadlGenerator.WADL_NS, "include"), "href", loc, "", m, ui);
                         }
                         
                         List<Element> resourceEls = DOMUtils.getChildrenWithName(appEl,

@@ -890,9 +891,9 @@ public class WadlGenerator implements Re
                 if (is != null) {
                     Element docEl = DOMUtils.readXml(is).getDocumentElement();
                     handleSchemaRefs(DOMUtils.getChildrenWithName(docEl, 
-                        XmlSchemaConstants.XSD_NAMESPACE_URI, "import"), "schemaLocation",
loc, href, ui);
+                        XmlSchemaConstants.XSD_NAMESPACE_URI, "import"), "schemaLocation",
loc, href, m, ui);
                     handleSchemaRefs(DOMUtils.getChildrenWithName(docEl, 
-                        XmlSchemaConstants.XSD_NAMESPACE_URI, "include"), "schemaLocation",
loc, href, ui);
+                        XmlSchemaConstants.XSD_NAMESPACE_URI, "include"), "schemaLocation",
loc, href, m, ui);
                     return Response.ok().type(MediaType.APPLICATION_XML_TYPE).entity(
                         new DOMSource(docEl)).build();
                 }
@@ -905,7 +906,7 @@ public class WadlGenerator implements Re
     }
 
     private void handleSchemaRefs(List<Element> schemaRefEls, String attrName, 
-                                  String parentDocLoc, String parentRef, UriInfo ui) {
+                                  String parentDocLoc, String parentRef, Message m, UriInfo
ui) {
         int index = parentDocLoc.lastIndexOf('/');
         parentDocLoc = index == -1 ? parentDocLoc : parentDocLoc.substring(0, index + 1);
         
@@ -917,7 +918,7 @@ public class WadlGenerator implements Re
             if (!StringUtils.isEmpty(href)) {
                 String actualRef = parentRef + href;
                 schemaLocationMap.put(actualRef, parentDocLoc + href);   
-                URI schemaURI = ui.getBaseUriBuilder().path(actualRef).build();
+                URI schemaURI = UriBuilder.fromUri(getBaseURI(m, ui)).path(actualRef).build();
                 DOMUtils.setAttribute(schemaRefEl, attrName, schemaURI.toString());
             }
         }



Mime
View raw message