CustomSearchParameterBean
- a bean containing search parameters.SearchResultsBean
- a bean storing results of basic search (tag search)AdvancedSearchResultsBean
- a bean storing results of advanced searchpublic interface ISearchService<SearchResultsBean,AdvancedSearchResultsBean,CustomSearchParameterBean,MediaTypeValueList>
Using service clients for SearchService
When using generated clients to access SearchService, ArrayOfString objects have to be used as demonstrated in the following example.
Example : Searching resources created by "admin" and having "foo" as a property name
CustomSearchParameterBean parameterBean = new CustomSearchParameterBean();
ArrayOfString[] aos = new ArrayOfString[2]; // No. of parameters to be passed is 2, namely author
and property name
aos[0] = new ArrayOfString();
aos[0].addArray("author"); // search parameter name
aos[0].addArray("admin"); // search parameter value
aos[1] = new ArrayOfString();
aos[1].addArray("propertyName"); // search parameter name
aos[1].addArray("foo"); // search parameter value
parameterBean.setParameterValues(aos);
SearchAdminServiceStub ssClient = createSearchService(cookie, serverURL, configContext);
AdvancedSearchResultsBean bean = ssClient.getAdvancedSearchResults(parameterBean);
CustomParameterBean encapsulates an ArrayOfString array which will contain all the parameters to be sent to SearchService. Altogether, this array can have up to 13 elements each representing "resourcePath", "author", "updater", "createdAfter", "createdBefore", "updatedAfter", "updatedBefore", "commentWords", "tags", "propertyName", "propertyValue", "content" or "mediaType". In the above case only "author" and "propertyName" have been used.
Each element should be an ArrayOfString object which has the parameter name (one of the 13 listed above) as the zeroth element and corresponding parameter value (search key) as the 1st element.
Statistics:
Modifier and Type | Method and Description |
---|---|
void |
deleteFilter(String filterName)
Delete a selected filter
|
CustomSearchParameterBean |
getAdvancedSearchFilter(String filterName)
Returns the filter to populate advanced search fields
|
AdvancedSearchResultsBean |
getAdvancedSearchResults(CustomSearchParameterBean parameters)
This method generates a search query according to parameters passed, and runs this query against the Registry and returns matching resutls
|
MediaTypeValueList |
getMediaTypeSearch(String mediaType)
Returns the
|
String[] |
getSavedFilters()
Return names of all saved filters
|
SearchResultsBean |
getSearchResults(String searchType,
String criteria)
This method generates a search query that runs against the Registry and returns matching results
|
void |
saveAdvancedSearchFilter(CustomSearchParameterBean queryBean,
String filterName)
Saves the advanced search fields as a filter for later retrieval
|
SearchResultsBean getSearchResults(String searchType, String criteria) throws org.wso2.carbon.registry.core.exceptions.RegistryException
searchType
- - String which indicates whether the search is a 'tag' search or a 'content' searchcriteria
- - The actual tags or content that needs to be searched fororg.wso2.carbon.registry.core.exceptions.RegistryException
- - if Registry is not availableAdvancedSearchResultsBean getAdvancedSearchResults(CustomSearchParameterBean parameters) throws org.wso2.carbon.registry.core.exceptions.RegistryException
parameters
- - Bean which contains a 2D array with parameters and their respective valuesorg.wso2.carbon.registry.core.exceptions.RegistryException
- - if Registry is not availableMediaTypeValueList getMediaTypeSearch(String mediaType) throws org.wso2.carbon.registry.core.exceptions.RegistryException
mediaType
- - String containing the media type. Ex: "application/xml"org.wso2.carbon.registry.core.exceptions.RegistryException
void saveAdvancedSearchFilter(CustomSearchParameterBean queryBean, String filterName) throws org.wso2.carbon.registry.core.exceptions.RegistryException
queryBean
- - Bean with parameters and their respective valuesfilterName
- - Name to be saved for this filterorg.wso2.carbon.registry.core.exceptions.RegistryException
- - if Registry is not availableCustomSearchParameterBean getAdvancedSearchFilter(String filterName) throws org.wso2.carbon.registry.core.exceptions.RegistryException
filterName
- - Saved filter nameorg.wso2.carbon.registry.core.exceptions.RegistryException
String[] getSavedFilters() throws org.wso2.carbon.registry.core.exceptions.RegistryException
org.wso2.carbon.registry.core.exceptions.RegistryException
void deleteFilter(String filterName) throws org.wso2.carbon.registry.core.exceptions.RegistryException
org.wso2.carbon.registry.core.exceptions.RegistryException
Copyright © 2023 WSO2. All Rights Reserved.