diff options
author | Olivier Lamy <olamy@apache.org> | 2012-10-05 15:48:08 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-10-05 15:48:08 +0000 |
commit | b57d1456be73ed43201a2aa3e8363835a11768d3 (patch) | |
tree | 97ee2a47e12f69601e7ca7d667474866e1301533 /archiva-modules | |
parent | 2aed326efb069c113ab20e6a105bd9f63aa7880e (diff) | |
download | archiva-b57d1456be73ed43201a2aa3e8363835a11768d3.tar.gz archiva-b57d1456be73ed43201a2aa3e8363835a11768d3.zip |
add rest doc for ui services
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1394607 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-js/pom.xml | 2 | ||||
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-js/src/enunciate/enunciate.xml | 43 | ||||
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/docs/RestDocsServlet.java (renamed from archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/docs/RestDocsServlet.java) | 2 | ||||
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/web.xml | 2 | ||||
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/docs.js | 19 | ||||
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js | 6 | ||||
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html | 2 |
7 files changed, 73 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/pom.xml b/archiva-modules/archiva-web/archiva-webapp-js/pom.xml index 529764f87..8c0eb6f3b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp-js/pom.xml @@ -40,6 +40,8 @@ <archiva.baseRestUrl /> <rest.admin.pwd /> <test.useTomcat>false</test.useTomcat> + <enunciate.docsDir>${project.build.outputDirectory}/rest-docs-archiva-ui</enunciate.docsDir> + </properties> <dependencies> diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/enunciate/enunciate.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/enunciate/enunciate.xml new file mode 100644 index 000000000..b76ab51c1 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/enunciate/enunciate.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ 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"> + + <services> + <rest defaultRestSubcontext="archivaUiServices"/> + </services> + + <modules> + + <cxf disabled="false"/> + <jersey disabled="true" /> + <c disabled="true"/> + <csharp disabled="true"/> + <obj-c disabled="true"/> + <jaxws-ri disabled="true"/> + <jaxws-support disabled="true"/> + + <docs disabled="false" title="Apache Archiva UI REST API" includeExampleXml="true" includeExampleJson="true" + includeDefaultDownloads="false"> + <war docsDir="apidocs" /> + </docs> + + </modules> + +</enunciate>
\ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/docs/RestDocsServlet.java b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/docs/RestDocsServlet.java index 993adbed7..020f171a4 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/docs/RestDocsServlet.java +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/docs/RestDocsServlet.java @@ -1,4 +1,4 @@ -package org.apache.archiva.rest.docs; +package org.apache.archiva.webapp.ui.services.docs; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/web.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/web.xml index 7f5c8acb0..eb89242f2 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/web.xml +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/web.xml @@ -81,7 +81,7 @@ <servlet> <servlet-name>RestDocumentation</servlet-name> - <servlet-class>org.apache.archiva.rest.docs.RestDocsServlet</servlet-class> + <servlet-class>org.apache.archiva.webapp.ui.services.docs.RestDocsServlet</servlet-class> <load-on-startup>3</load-on-startup> </servlet> diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/docs.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/docs.js index 518e5fb99..4dcd8e8a2 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/docs.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/docs.js @@ -38,6 +38,25 @@ define("archiva.docs",["jquery","i18n","jquery.tmpl","bootstrap"], function() { }); } + goToArchivaRestUiDoc=function(target){ + $("#main-content" ).html(mediumSpinnerImg()); + $.ajax({ + url:"rest-docs/rest-docs-archiva-ui/"+target, + type:"get", + dataType: "html", + success: function(data){ + $("#main-content" ).html($("#rest_docs").tmpl()); + $("#main-content" ).find("#rest_docs_content" ).html(data); + prettyPrint(); + } + }); + } + + + displayArchivaRestUIDocs=function(){ + window.sammyArchivaApplication.setLocation("#rest-docs-archiva-ui/index.html"); + } + displayArchivaRestDocs=function(){ window.sammyArchivaApplication.setLocation("#rest-docs-archiva-rest-api/index.html"); } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js index 9685961c5..712f6ce7d 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js @@ -637,6 +637,12 @@ function(jquery,ui,sammy,tmpl) { goToArchivaRestDoc(target); }); + this.get("#rest-docs-archiva-ui/:target",function(){ + var target=this.params.target; + $.log("archiva-rest-docs-ui, target:"+target); + goToArchivaRestUiDoc(target); + }); + }); }; diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html index c1e1a9f28..b03cb0b30 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html @@ -25,6 +25,7 @@ <div id="docs_rest_choice"> <ul> <li><a onclick="displayArchivaRestDocs();">Archiva Rest Api Docs</a></li> + <li><a onclick="displayArchivaRestUIDocs();">Archiva Rest Api UI Docs</a></li> </ul> </div> </div> @@ -33,5 +34,4 @@ </script> <script id="users_docs" type="text/html"> - rest docs </script>
\ No newline at end of file |