]> source.dussan.org Git - archiva.git/commitdiff
more search snippet links
authorOlivier Lamy <olamy@apache.org>
Fri, 16 Sep 2011 15:25:45 +0000 (15:25 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 16 Sep 2011 15:25:45 +0000 (15:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1171623 13f79535-47bb-0310-9956-ffa450edef68

archiva-docs/src/site/apt/adminguide/webservices/rest.apt.vm
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java

index e9076938ab94a14282e294df591322acc55b5b72..f227baecf9ee2c91c1f09fb148709d5df790c3b2 100644 (file)
@@ -30,6 +30,7 @@ Using REST Services
 
   Starting version 1.4, you can use some REST Services to manage your Apache Archiva instance and Search artifacts.
   All samples here will use Apache CXF REST client API. By the way you can use some others REST client frameworks.
+  NOTE: a wadl is available in your Archiva instance : http(s)://ip:port/..//restServices/application.wadl
 
 * Search Service
 
@@ -41,3 +42,24 @@ Using REST Services
    Get a Search Service Client :
 
 %{snippet|id=cxf-searchservice-creation|url=http://svn.apache.org/repos/asf/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java}
+
+   Quick Search
+
+%{snippet|id=quick-search|url=http://svn.apache.org/repos/asf/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java}
+
+   Search Artifacts Version : to search all availables version with a groupId and artifactId and packaging (if empty jar is used)
+
+%{snippet|id=searchservice-artifact-versions|url=http://svn.apache.org/repos/asf/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java}
+
+  Search Service with a classifier :
+
+%{snippet|id=searchservice-with-classifier|url=http://svn.apache.org/repos/asf/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java}
+
+  Search Service with a classifier :
+
+%{snippet|id=searchservice-with-classifier|url=http://svn.apache.org/repos/asf/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java}
+
+  To know all the possible options, you can refer to the javadoc of SearchRequest class.
+
+
+
index ca04f297ce34ba78fcd95f6a259e2661b862e3de..be39925e091762eb60bba431abc2a20a962772e0 100644 (file)
@@ -55,7 +55,8 @@ public class SearchServiceTest
 
         // START SNIPPET: quick-search
         List<Artifact> artifacts = searchService.quickSearch( "commons-logging" );
-        // return all artifacts with groupId OR artifactId
+        // return all artifacts with groupId OR artifactId OR version OR packaging OR className
+        // NOTE : only artifacts with classifier empty are returned
         // START SNIPPET: quick-search
 
         assertNotNull( artifacts );
@@ -111,12 +112,14 @@ public class SearchServiceTest
 
         SearchService searchService = getSearchService( authorizationHeader );
 
+        // START SNIPPET: searchservice-with-classifier
         SearchRequest searchRequest = new SearchRequest();
         searchRequest.setGroupId( "commons-logging" );
         searchRequest.setArtifactId( "commons-logging" );
         searchRequest.setClassifier( "sources" );
 
         List<Artifact> artifacts = searchService.searchArtifacts( searchRequest );
+        // END SNIPPET: searchservice-with-classifier
 
         assertNotNull( artifacts );
         assertTrue( " not 2 results for commons-logging search but " + artifacts.size() + ":" + artifacts,
@@ -142,8 +145,10 @@ public class SearchServiceTest
 
         SearchService searchService = getSearchService( authorizationHeader );
 
+        // START SNIPPET: searchservice-with-osgi
         SearchRequest searchRequest = new SearchRequest();
         searchRequest.setBundleSymbolicName( "org.apache.karaf.features.command" );
+        // END SNIPPET: searchservice-with-osgi
 
         List<Artifact> artifacts = searchService.searchArtifacts( searchRequest );