Repository: archiva
Updated Branches:
  refs/heads/master 8b820c13d -> 5d5b0733d


put documentation on the same folder as before 2.0.0x migration
make servlet compatible with new layout (not enough)

Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/5d5b0733
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/5d5b0733
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/5d5b0733

Branch: refs/heads/master
Commit: 5d5b0733de195c043ec8b1f733eb1788e1ea750c
Parents: 8b820c1
Author: Eric Barboni <[email protected]>
Authored: Thu Oct 8 19:09:48 2015 +0200
Committer: Eric Barboni <[email protected]>
Committed: Thu Oct 8 19:09:48 2015 +0200

----------------------------------------------------------------------
 .../archiva-rest-api/src/enunciate/enunciate.xml   |  6 +++---
 .../archiva-web-common/src/enunciate/enunciate.xml |  6 +++---
 .../apache/archiva/web/docs/RestDocsServlet.java   | 17 ++++++++++++++---
 3 files changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/5d5b0733/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml
 
b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml
index d0d195e..25d2dfe 100644
--- 
a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml
+++ 
b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml
@@ -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>

http://git-wip-us.apache.org/repos/asf/archiva/blob/5d5b0733/archiva-modules/archiva-web/archiva-web-common/src/enunciate/enunciate.xml
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-web/archiva-web-common/src/enunciate/enunciate.xml 
b/archiva-modules/archiva-web/archiva-web-common/src/enunciate/enunciate.xml
index b76ab51..f685321 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/enunciate/enunciate.xml
+++ b/archiva-modules/archiva-web/archiva-web-common/src/enunciate/enunciate.xml
@@ -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>

http://git-wip-us.apache.org/repos/asf/archiva/blob/5d5b0733/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
 
b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
index 4ee7f3e..c5e47a5 100644
--- 
a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
+++ 
b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
@@ -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() );
 
     }

Reply via email to