Java Code Examples for org.wso2.carbon.apimgt.impl.utils.APIUtil#searchAPIsByDoc()

The following examples show how to use org.wso2.carbon.apimgt.impl.utils.APIUtil#searchAPIsByDoc() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserAwareAPIProvider.java    From carbon-apimgt with Apache License 2.0 6 votes vote down vote up
@Override
public Map<Documentation, API> searchAPIDoc(Registry registry, int tenantID, String username, String searchTerm)
        throws APIManagementException {
    Map<Documentation, API> apiByDocumentation = APIUtil
            .searchAPIsByDoc(registry, tenantId, username, searchTerm, APIConstants.PUBLISHER_CLIENT);
    Map<Documentation, API> filteredAPIDocumentation = new HashMap<Documentation, API>();
    if (apiByDocumentation != null) {
        for (Map.Entry<Documentation, API> entry : apiByDocumentation.entrySet()) {
            API api = entry.getValue();
            if (api != null) {
                checkAccessControlPermission(api.getId());
                filteredAPIDocumentation.put(entry.getKey(), api);
            }
        }
        return filteredAPIDocumentation;
    }
    return null;
}
 
Example 2
Source File: AbstractAPIManager.java    From carbon-apimgt with Apache License 2.0 2 votes vote down vote up
/**
 * Search Apis by Doc Content
 *
 * @param registry     - Registry which is searched
 * @param tenantID     - Tenant id of logged in domain
 * @param username     - Logged in username
 * @param searchTerm   - Search value for doc
 * @return - Documentation to APIs map
 * @throws APIManagementException - If failed to get ArtifactManager for given tenant
 */
public Map<Documentation, API> searchAPIDoc(Registry registry, int tenantID, String username,
        String searchTerm) throws APIManagementException {
    return APIUtil.searchAPIsByDoc(registry, tenantID, username, searchTerm, APIConstants.STORE_CLIENT);
}