Re: API for simple search (73 Views)
Reply
Occasional Visitor
darora
Posts: 1
Registered: ‎07-03-2008
Message 1 of 3 (154 Views)

API for simple search

Hi,

I would like to use the Systinet API to do simple searches based on the Service Name. I can see that through the UI I can go to Search->Services->Find Service(By Names)->Add Name->Find ( Home > Find service) and then search a service by name, without providing a serviceKey or businessKey.

I would like to do the same as above but through an API call from Java. Please let me know (or point to actual servlet/class that does the above in the UI) how I can do this using the Systinet API.

I have reviewed the examples but they all require either a serviceKey or businessKey+Catalog.

Thanks for your help!

D
Please use plain text.
Occasional Visitor
koitoer
Posts: 2
Registered: ‎12-06-2012
Message 2 of 3 (115 Views)

Re: API for simple search

Hi dacora.

 

I think you are able to do the search you need using.

RepositoryClient repositoryClient;

 

This Class have a method named

search, which parameters are artfactType, searchCriteria.

 

search(java.lang.String artifactType, java.util.List<Pair<java.lang.String,java.lang.String>> searchCriteria, java.lang.String orderBy, int first, int count)

 

for examplet if you are looking for XML service then artifactType will be xmlArtifact, the name must to be the same that the one used in model.

 

About searchCriteria as you can see is a List that contains Pair<String, String>, you can set in the first String the name of the attribute in which you want to based your search and in the other string the value that you try to match.

 

 

 

List<Pair<String, String>> searchCriteria = newArrayList<Pair<String,String>>();  

searchCriteria.add(new Pair<String,String>("_domainId","defaultDomain"));

 

First string or name or the attribute must be the same that the one used in model again.

 

Hope this help you.

Please use plain text.
Occasional Visitor
ManuelRosa
Posts: 1
Registered: ‎11-06-2013
Message 3 of 3 (73 Views)

Re: API for simple search

Hello!

 

Has anybody had a problem while using API to search for artifacts, and only getting the first 500 items? We have more than 500 services in our Systinet, and the API only provides the first 500...

 

Thanks!!

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation