]> source.dussan.org Git - archiva.git/commitdiff
put documentation on the same folder as before 2.0.0x migration
authorEric Barboni <skygo@apache.org>
Thu, 8 Oct 2015 17:09:48 +0000 (19:09 +0200)
committerEric Barboni <skygo@apache.org>
Thu, 8 Oct 2015 17:09:48 +0000 (19:09 +0200)
make servlet compatible with new layout (not enough)

archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml
archiva-modules/archiva-web/archiva-web-common/src/enunciate/enunciate.xml
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java

index d0d195e7e5424d04b4eb263894640d03755be6aa..25d2dfe5c762332b5de5321b65cf1c89bf506150 100644 (file)
@@ -17,7 +17,7 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
-<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
+<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.0.0.xsd">
 
   <services>
     <rest defaultRestSubcontext="restServices"/>
@@ -34,8 +34,8 @@
     <jaxws-support disabled="true"/>
 
     <docs disabled="false" title="Apache Archiva REST API" includeExampleXml="true" includeExampleJson="true"
-          includeDefaultDownloads="false">
-      <war docsDir="apidocs" />
+          includeDefaultDownloads="false" docsSubdir="">
+      <!--<war docsDir="apidocs" />-->
     </docs>
 
   </modules>
index b76ab51c1911a0b6046aba28f979f252cb0a817c..f68532179dddf561018e05ffd5a9797e584d3aa6 100644 (file)
@@ -17,7 +17,7 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
-<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
+<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.0.0.xsd">
 
   <services>
     <rest defaultRestSubcontext="archivaUiServices"/>
@@ -34,8 +34,8 @@
     <jaxws-support disabled="true"/>
 
     <docs disabled="false" title="Apache Archiva UI REST API" includeExampleXml="true" includeExampleJson="true"
-          includeDefaultDownloads="false">
-      <war docsDir="apidocs" />
+          includeDefaultDownloads="false" docsSubdir="">
+     <!-- <war docsDir="apidocs" />-->
     </docs>
 
   </modules>
index 4ee7f3ea34f6ee6ba135a34b323e38a894a0d560..c5e47a517f869c1bc0295f5d943e7e361dd37184 100644 (file)
@@ -66,13 +66,19 @@ public class RestDocsServlet
         // replace all links !!
         Document document = Jsoup.parse( is, "UTF-8", "" );
 
-        Element body = document.body().child( 0 );
+        Element body = document.body();
 
         Elements links = body.select( "a[href]" );
 
         for ( Element link : links ) {
             link.attr( "href", "#" + startPath + "/" + link.attr( "href" ) );
         }
+        
+        Elements datalinks = body.select( "[data-href]" );
+
+        for ( Element link : datalinks ) {
+            link.attr( "data-href", "#" + startPath + "/" + link.attr( "data-href" ) );
+        }
 
         Elements codes = body.select( "code" );
 
@@ -101,8 +107,13 @@ public class RestDocsServlet
         }
 
         Document res = new Document( "" );
-        res.appendChild( body.select( "div[id=main]" ).first() );
-
+        res.appendChild( body.select( "div[class=container-fluid]" ).last() );
+        
+        Elements scripts = body.select( "script" );
+        for ( Element script : scripts )
+        {
+             res.appendChild( script );
+        } 
         resp.getOutputStream().write( res.outerHtml().getBytes() );
 
     }