Search in sources :

Example 1 with Catalog

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

the class CatalogContentHandler method startElement.

@Override
public void startElement(String uri, String localName, Attributes attributes) {
    if (localName.equals("catalog")) {
        // $NON-NLS-1$
        model = new Catalog();
        // $NON-NLS-1$
        model.setId(attributes.getValue(NS_URI, "id"));
        // $NON-NLS-1$
        model.setName(attributes.getValue(NS_URI, "title"));
        // $NON-NLS-1$
        model.setUrl(toUrlString(attributes.getValue(NS_URI, "url")));
        // $NON-NLS-1$ //$NON-NLS-2$
        model.setSelfContained("1".equals(attributes.getValue(NS_URI, "selfContained")));
        // $NON-NLS-1$
        model.setImageUrl(toUrlString(attributes.getValue(NS_URI, "icon")));
    } else if (localName.equals("dependenciesRepository")) {
        // $NON-NLS-1$
        capturingContent = true;
    } else if (localName.equals("description")) {
        // $NON-NLS-1$
        capturingContent = true;
    } else if (localName.equals("wizard")) {
        // $NON-NLS-1$
        org.eclipse.epp.internal.mpc.core.service.xml.CatalogBrandingContentHandler childHandler = new org.eclipse.epp.internal.mpc.core.service.xml.CatalogBrandingContentHandler();
        childHandler.setParentModel(model);
        childHandler.setParentHandler(this);
        childHandler.setUnmarshaller(getUnmarshaller());
        getUnmarshaller().setCurrentHandler(childHandler);
        childHandler.startElement(uri, localName, attributes);
    } else if (localName.equals("news")) {
        // $NON-NLS-1$
        org.eclipse.epp.internal.mpc.core.service.xml.NewsContentHandler childHandler = new org.eclipse.epp.internal.mpc.core.service.xml.NewsContentHandler();
        childHandler.setParentModel(model);
        childHandler.setParentHandler(this);
        childHandler.setUnmarshaller(getUnmarshaller());
        getUnmarshaller().setCurrentHandler(childHandler);
        childHandler.startElement(uri, localName, attributes);
    }
}
Also used : Catalog(org.eclipse.epp.internal.mpc.core.model.Catalog)

Example 2 with Catalog

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

the class DefaultCatalogService method listCatalogs.

public List<? extends ICatalog> listCatalogs(IProgressMonitor monitor) throws CoreException {
    // $NON-NLS-1$
    Catalogs result = processRequest("catalogs/" + API_URI_SUFFIX, monitor);
    List<Catalog> catalogs = result.getCatalogs();
    for (Catalog catalog : catalogs) {
        registerDynamicFavoritesService(catalog);
    }
    return catalogs;
}
Also used : Catalogs(org.eclipse.epp.internal.mpc.core.model.Catalogs) ICatalog(org.eclipse.epp.mpc.core.model.ICatalog) Catalog(org.eclipse.epp.internal.mpc.core.model.Catalog)

Aggregations

Catalog (org.eclipse.epp.internal.mpc.core.model.Catalog)2 Catalogs (org.eclipse.epp.internal.mpc.core.model.Catalogs)1 ICatalog (org.eclipse.epp.mpc.core.model.ICatalog)1