put documentation on the same folder as before 2.0.0x migration

make servlet compatible with new layout (not enough)
This commit is contained in:
Eric Barboni 2015-10-08 19:09:48 +02:00
parent 8b820c13d4
commit 5d5b0733de
3 changed files with 20 additions and 9 deletions

View 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>

View 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>

View File

@ -66,7 +66,7 @@ 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]" );
@ -74,6 +74,12 @@ public class RestDocsServlet
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" );
for ( Element code : codes ) {
@ -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() );
}