From b57d1456be73ed43201a2aa3e8363835a11768d3 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 5 Oct 2012 15:48:08 +0000 Subject: [PATCH] add rest doc for ui services git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1394607 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-web/archiva-webapp-js/pom.xml | 2 + .../src/enunciate/enunciate.xml | 43 +++++++++++++++++++ .../ui/services}/docs/RestDocsServlet.java | 2 +- .../src/main/webapp/WEB-INF/web.xml | 2 +- .../src/main/webapp/js/archiva/docs.js | 19 ++++++++ .../src/main/webapp/js/archiva/main.js | 6 +++ .../webapp/js/templates/archiva/docs.html | 2 +- 7 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 archiva-modules/archiva-web/archiva-webapp-js/src/enunciate/enunciate.xml rename archiva-modules/archiva-web/{archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest => archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services}/docs/RestDocsServlet.java (98%) 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 @@ false + ${project.build.outputDirectory}/rest-docs-archiva-ui + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 similarity index 98% rename from archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/docs/RestDocsServlet.java rename to 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 @@ RestDocumentation - org.apache.archiva.rest.docs.RestDocsServlet + org.apache.archiva.webapp.ui.services.docs.RestDocsServlet 3 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 @@ @@ -33,5 +34,4 @@ \ No newline at end of file -- 2.39.5