Search in sources :

Example 6 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult in project epp.mpc by eclipse.

the class MarketplaceDiscoveryStrategy method featured.

public void featured(IProgressMonitor monitor, final IMarket market, final ICategory category) throws CoreException {
    SubMonitor progress = SubMonitor.convert(monitor, Messages.MarketplaceDiscoveryStrategy_searchingMarketplace, 1001);
    try {
        MarketplaceCategory catalogCategory = findMarketplaceCategory(progress.newChild(1));
        catalogCategory.setContents(Contents.FEATURED);
        ISearchResult result = marketplaceService.featured(market, category, progress.newChild(500));
        handleSearchResult(catalogCategory, result, progress.newChild(500));
        maybeAddCatalogItem(catalogCategory);
    } finally {
        monitor.done();
    }
}
Also used : ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) SubMonitor(org.eclipse.core.runtime.SubMonitor)

Example 7 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult in project epp.mpc by eclipse.

the class MarketplaceDiscoveryStrategy method popular.

public void popular(IProgressMonitor monitor) throws CoreException {
    SubMonitor progress = SubMonitor.convert(monitor, Messages.MarketplaceDiscoveryStrategy_searchingMarketplace, 1001);
    try {
        MarketplaceCategory catalogCategory = findMarketplaceCategory(progress.newChild(1));
        catalogCategory.setContents(Contents.POPULAR);
        ISearchResult result = marketplaceService.popular(progress.newChild(500));
        handleSearchResult(catalogCategory, result, progress.newChild(500));
        maybeAddCatalogItem(catalogCategory);
    } finally {
        monitor.done();
    }
}
Also used : ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) SubMonitor(org.eclipse.core.runtime.SubMonitor)

Example 8 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult in project epp.mpc by eclipse.

the class MarketplaceDiscoveryStrategy method performDiscovery.

@Override
public void performDiscovery(IProgressMonitor monitor) throws CoreException {
    SubMonitor progress = SubMonitor.convert(monitor, Messages.MarketplaceDiscoveryStrategy_loadingMarketplace, 3000);
    try {
        MarketplaceCategory catalogCategory = findMarketplaceCategory(progress.newChild(1000));
        handleDiscoveryCategory(catalogCategory);
        ISearchResult discoveryResult = doPerformDiscovery(progress.newChild(1000));
        handleSearchResult(catalogCategory, discoveryResult, progress.newChild(1000));
        maybeAddCatalogItem(catalogCategory);
    } finally {
        monitor.done();
    }
}
Also used : ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) SubMonitor(org.eclipse.core.runtime.SubMonitor)

Example 9 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult in project epp.mpc by eclipse.

the class MarketplaceDiscoveryStrategy method recent.

public void recent(IProgressMonitor monitor) throws CoreException {
    SubMonitor progress = SubMonitor.convert(monitor, Messages.MarketplaceDiscoveryStrategy_searchingMarketplace, 1001);
    try {
        MarketplaceCategory catalogCategory = findMarketplaceCategory(progress.newChild(1));
        catalogCategory.setContents(Contents.RECENT);
        ISearchResult result = marketplaceService.recent(progress.newChild(500));
        handleSearchResult(catalogCategory, result, progress.newChild(500));
        maybeAddCatalogItem(catalogCategory);
    } finally {
        monitor.done();
    }
}
Also used : ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) SubMonitor(org.eclipse.core.runtime.SubMonitor)

Example 10 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult in project epp.mpc by eclipse.

the class MarketplaceDiscoveryStrategy method related.

public void related(IProgressMonitor monitor) throws CoreException {
    SubMonitor progress = SubMonitor.convert(monitor, Messages.MarketplaceDiscoveryStrategy_searchingMarketplace, 801);
    try {
        MarketplaceCategory catalogCategory = findMarketplaceCategory(progress.newChild(1));
        catalogCategory.setContents(Contents.RELATED);
        SearchResult installed = computeInstalled(progress.newChild(200));
        if (!monitor.isCanceled()) {
            ISearchResult result = marketplaceService.related(installed.getNodes(), progress.newChild(300));
            handleSearchResult(catalogCategory, result, progress.newChild(300));
            maybeAddCatalogItem(catalogCategory);
        }
    } finally {
        monitor.done();
    }
}
Also used : ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) SubMonitor(org.eclipse.core.runtime.SubMonitor) ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) SearchResult(org.eclipse.epp.internal.mpc.core.model.SearchResult)

Aggregations

ISearchResult (org.eclipse.epp.mpc.core.model.ISearchResult)21 SubMonitor (org.eclipse.core.runtime.SubMonitor)8 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)6 Test (org.junit.Test)6 CoreException (org.eclipse.core.runtime.CoreException)5 INode (org.eclipse.epp.mpc.core.model.INode)5 NoSuchElementException (java.util.NoSuchElementException)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 Node (org.eclipse.epp.internal.mpc.core.model.Node)2 SearchResult (org.eclipse.epp.internal.mpc.core.model.SearchResult)2 ICategory (org.eclipse.epp.mpc.core.model.ICategory)2 IMarket (org.eclipse.epp.mpc.core.model.IMarket)2 IMarketplaceService (org.eclipse.epp.mpc.core.service.IMarketplaceService)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 Callable (java.util.concurrent.Callable)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1