Simple search

The simplest way to construct a search query is to use the RAMSession.createAssetQuery(String) method. You can pass any string that you would type into the search input box in the web or Eclipse client. Or you can paste a search shortcut found under the Search text box on the web client.

Screenshot of search shortcut in Web Client

In the Eclipse client you can get a search shortcut using the Copy to Clipboard from the drop down menu on the in the asset search view.

The createAssetQuery method will return a RAMAssetQueryBuilder object casted down to the simplified SeachQuery object. This object can be passed to the method RAMSession.getAssets(SearchQuery) and it will return a RAMSearchResult object casted down to the common SearchResult object. From the SearchResult object you can get the total number of assets that meet this search query along with a list of RAMAsset objects for this page of results.

Here is an example of a simple search for all assets that match the words "Rational Asset Manager" and "javadoc":

                SearchQuery query = session.createAssetQuery("Rational Asset Manager javadoc");
                SearchResult searchResult = session.getAssets(query);
                RAMAssetSearchResult[] assets = (RAMAssetSearchResult[])searchResult.getAssetSearchResults();

Feedback